That’s a real wide-ranging question.
All else equal, an airfoil with a leading edge at 90 degrees to the airflow is most efficient at processing airflow into lift. E.g. the Piper Cherokee “hershey bar” wing.
However, as speeds approach the high subsonic to trans-sonic range, the drag gets awful. Adding leading edge sweep pushes the knee in the drag curve upwards, at the expense of reduced lifting efficiency at all speeds. The efficiency reduction is due to spanwise flow.
Meanwhile, as wings get longer (e.g. any airliner), there are structural efficiencies to be gained by tapering the wing. So you get a trailing edge sweep which is less than the leading edge sweep.
Once you get supersonic, there is further advantage in having the leading edge wing sweep exceed the Mach shock angle. Hence the deep deltas of Concorde, the Dassault Mirage series, the F102, F106.
The pure trapezoidal shape of the T-38 & F-104 are not found in more modern designs. That was state of the art thinking in 1960.
Also, understand that different wings are for different purposes. The wing on a Rafale or F-16 is designed for aggressive manuevering, not for cruise. The wing on a 777 is designed for cruise, not for aggressive manuevering.
While the intended speed regime has an impact on the design, the cruise vs manuevering mission has a lot more impact on overall wing shape. Compare, for example, the wing shape of a DC-7 and a P-47 or P-51. Similar speeds, similar tech. Very different shapes.
It’s an error to compare the wing shape of a 747 and an F-16 and conclude the difference is due to their different max speeds. It’s got a lot more to do with their different limit G loads and flight envelope optimization points.