Why does flying inverted in a jet trainer starve the engine of fuel when there's a pump?
I find it hard to make a general answer since the fuel systems could be different between various aircraft, but, according to Jan Roskam's Aircraft Design series (I just had to return the book, but I think it's Part IV in the series) some model of the F/A-18 utilizes the following system which, in sustained inverted flight (or any sustained flight condition wherein the aircraft does not experience a positive load factor), would eventually starve the engine of fuel.  Keep in mind too that fuel isn't the only factor for sustaining this flight condition: oil flow through the engine is typically gravity fed (reference for that is an engineer from Bell Helicopter who worked on the V-22 powerplant).  Suction is used to scavenge the oil out of the engine/gearboxes/etc, but the flow of the oil up to a point where suction will pull it out is via gravity (or whatever acceleration the aircraft is experiencing).  Hence, not only do we need to provide fuel, but we also need to provide for proper oil flow as well.

Anyhow, the F/A-18 fuel system.  Again, I wish I had the image from the text to show you, but the basic idea is this: if you had a flop tube capable of scavenging from the entire fuel tank, it would engender more problems than it solved.  Hence, inside of the primary fuel tank there's a second, smaller tank.  This tank has a series of poppet valves that allow fuel to flow into the inset tank during coordinated (i.e., positive load factor) flight.  When the aircraft is not experiencing a positive load factor, the pressure of the fuel on these valves holds them closed and the fuel stays within the inset tank.  A short flop tube within this space provides fuel to the engines for the duration of the maneuver.  However, as noted, this inset tank is only a portion of the larger main tank, so its capacity would be some fraction of the main tank, limiting the duration of the maneuver.

So, to answer your question (how does fuel starvation happen and why isn't it solved via a pump) it's a design problem that, per the printing of that text, could not be solved by adding capacity to the pump.  There just simply wasn't fuel present at the fuel sump to be scavenged.  The real design problem would lie in the design of flop tubes capable of scavenging from the entire tank without creating more design problems (an assumed point on my part).  Examples, I think, would crop up if you decided to make a multiplicity of flop tubes (larger pumps required, more parts, more complex plumbing, etc.), or longer flop tubes (potential risk for damage to the tube head/tank with increased "flopping" inertia, larger pump required for greater head losses, etc.)...but I also don't know what the current standard is.