Question: When I play Modern Warfare 2 using anti-aliasing on my Macbook Pro and no monitor, the game lags too much to play.

But lo and behold: When I plug in a monitor to my Macbook Pro and turn on AA and put all textures to high, the game runs just fine.

Why is this? why does plugging in a monitor improve performance?

EDIT:

Without the monitor, I can run the game at medium resolution, but no VSync and no AA (but medium specular)

With the monitor, I can run the game at highest resolution, no VSync, 2x AA and medium specular unless there is lag.

Answer: 
Your display resolution is a huge factor in the speed of games; turning the resolution down can result in drastically more smooth gameplay, but at a steep cost of picture quality.

If your external monitor is of a lower resolution than your Macbook Pro's built-in display, then the game is playing at a lower resolution and therefore will run faster.

I see no other reason an external monitor would cause games to run faster than the internal monitor.
The driver uses dynamic performance levels depending on the card's load, which causes lag when switching from a lower level to a higher one or the other way around.

But when you use 2 monitors, it sticks to the max level, so that's why you see improved performance.

While I observed this on Linux, I'm fairly certain it applies to OS X too.