Three are two main factors for the difference between the two flights you've listed.
The first is the overhead of take-off, climb, decent and landing. These will be roughly equivalent for all flights, so are basically a fixed overhead.
For the two flights you've listed, the times you've given are those published by the airline and thus include the time from gate-to-gate, including taxi/etc.
Picking a LAX-ABQ at random, UA6474, FlightAware shows that the average flight time is actually around 1 hour 25 minutes, not 2 hours as you've stated. The 2 hours includes taxi time, and some additional buffer the airlines normally add in.
Picking a SJC-ORD at random, AA1008, FlightAware shows that the average flight time is actually around 3 hour 45 minutes, not 4 hours as you've stated. Again, the 4 hours includes taxi time.
Even then, that's ignoring the overhead of take-off/climb/decent/landing, which only occurs once per flight, and isn't related to the distance.
The second major factor is the type of plane, and thus the maximum speed flown. LAX-ABQ would normally be flown by a "regional" jet - a smaller, and less powerful plane often with a lower cruise speed. SJC-ORD would be flown by a "narrow-body" (or occasionally for other similar length flights a "wide-body") jet, which would normally have a higher cruise speed.
This will vary depending on the exact jets flown, but could be as much as 10% of more for the standard cruise speed.