The EPA tests were originally developed to quantify pollution generated by cars in the L.A. area, and using those tests to quantify gas mileage came later.
The EPA city cycle was not meant to represent the stop-and-go driving in Manhattan during rush hour. Rather, it was intended to be typical of an automobile trip in the L.A. area conducted on "surface streets", meaning major arterial roads that have stop lights and are not freeways. The average speed of that cycle is about 20 MPH. The EPA highway cycle was not meant to represent bombing down an open Interstate at 10-over a 70 MPH speed limit. Instead, it was to represent a trip on the 405 freeway in Los Angeles in the days before that road became a parking lot -- the test was meant to represent "moderate traffic" levels where the average speed is about 50 MPH.
Not only may your miles-per-gallon vary, the amount of BTUs in a gallon of gas can also vary downward from an alcohol-free summer blend that was probably the standard for the test -- the test conducted on rollers somewhere in Ann Arbor, MI doesn't actually measure the quantity of fuel used but instead measures the combustion products out the tailpipe and performs a mass balance with that standardized gasoline.
Taking the lower BTU fuel you may be getting into account, if you start the car engine from cold on a 70 deg-F day, don't run the A/C, and drive for about 10 miles in traffic where you average 20 MPH, you will roughly reproduce a city test, and I have found that the reading on a Scan Gauge, calibrated to tank fills, will get within 5 percent of the raw city numbers available here https://www3.epa.gov/otaq/tcld.... These numbers are considerable higher than the window sticker MPG rating available here https://www.fueleconomy.gov/. Driving on a not-that-hilly road (do this in both directions and take a harmonic average to compensate for net elevation change) on a 70-deg calm-wind day with the A/C off at a constant 55 MPH, if you can do that with angering other drivers, is a good proxy for the EPA highway test and will also get you within 5 percent.
"But no one drives that way!" someone will shout at you, and this may be true, but if you want to reproduce the EPA test conditions to see if you can match the (raw) EPA numbers, this is the way to check that.
The sticker MPG at fueleconomy.gov has had more than one "adjustment" performed to down rate it from the raw MPG. This was done because the published EPA ratings made people who considered themselves to be "good drivers" feel bad about themselves and their expensive new car purchases, and we cannot have any of that. Or rather, the "consumer" gas mileage numbers were proportionately reduced to "better reflect how real-world driving conditions on more congested city streets and with higher speed limits on highways affect mileage" whereas the Federal Test Procedure and the raw numbers for computing CAFE (corporate average fuel economy) were left the same so as to not keep changing the rules to which the car companies had to comply.
Now the down-adjusting is based on fleet averages, and your car may vary. A case in point is that Consumer Reports praised the Ford C-Max hybrid as being a lot more "fun to drive" than the Toyota Prius but slammed it for being much further off the EPA sticker in real-world driving than the Prius. Well, duh, Consumer Reports! Were you to drive both vehicles in a true "EPA city granny cycle", they probably would get proportionately higher than the window sticker as is the raw "test car" number. But left to the lead foot of a "normal driver", the C-Max with its bigger gas engine will indeed accelerate better yet use more gas than the small-engine sluggish Prius.
I also expect "eco-cars" like the Prius to suffer more from "normal driver" in relation to EPA test cycle driving because their power plants are more matched to the "granny cycle." A real "muscle car" may suffer less mileage loss from "aggressive driving" because when its motor is lightly loaded in the EPA test, much of its energy is going into overcoming wall thermal losses, internal mechanical and manifold vacuum throttling friction on account of its large displacement motor.
There are two points, however, that merit further investigation by auto geeks. One, the EPA test takes place on chassis rollers in that Ann Arbor, MI lab and not on a test track. The friction coefficients for those rollers of the form A v^2 + B v + C = F where v is velocity and F is the total drag force experienced by the vehicle, those coefficients are supplied to the EPA by the manufacturer based on their test-track roll-down tests. I have seen some "anomalies" in those A, B, and C friction coefficients where a particular car model is an outlier from similar cars. Are the manufacturers honest? As the day is long!
The second point is amount of manufacturing variation in cars and car engines. Does anyone know this? In other words, a 50 MPG Prius will get less than 50 MPG in practical use, but it should somehow get proportionately double the mileage as an SUV with a 25 MPG rating? But if I rented a different Prius each week, would I see the same gas mileage, or would that vary because each engine and transmission has a different amount of friction in it? Could I end up with a "lemon" car with bad gas mileage for that particular make, model, and engine?