What would cause a car to lose power?

Aside from lack of gasoline(or diesel), lack of power may also be driven by drained battery or lack of ignition(ignition system failure). the comment below is correct. it is hard to give a specific answer for this since there are a lot that can cause lack of power and it may variy from car makes and models.

Answer

Best to have problem diagnosed with proper equipment. A good shop could run obdII tests, smoke test for vaccum leaks, misfire or lack of ignition. One easy diagnosis is to spray carb or throttle body cleaner in the throttle while giving gas and if the engine improves you have a fuel delivery issue if it stays the same then you have a breather problem. (exhaust leaks, vaccum leaks, or emmission components.

Answer

if your whole car completely shut off your distributor cap could have came off. that happen to me one time while driving.