When you plug in a projector, the Mac does its best to make the display on the projector as good as it can. Since you have mirroring turned on, the Mac alters the computer's display to match. Sometimes this looks a bit odd with black bars at the top or on the sides, and with altered resolution and aspect ratio.
If the projector is on when you plug it in, the Mac may be able to get information from it to help it set the screen. If the Mac can't figure it out, it just does what it did last time, more or less.
If what you see isn't what you want, you should go to the "Displays" system preference and try different things to see what happens. Trial & error should get you just what you want. When you find it you should probably write the settings on the projector to make the next time easier. The Mac will probably remember the projector and automatically set it correctly next time, anyway.
The picture used for your desktop can be different with different settings. I would suggest that you plug in the projector, adjust the resolution in the "Displays" panel, and then go to he "Desktop & Screen Saver" preference to set the desktop the way you want it with the projector plugged in. The Mac should remember for next time, and it should go back to your original desktop picture when you un-plug the projector. If not, use the system preferences to adjust.
While most people use mirroring with a projector, as "um" said, you can turn mirroring off and have your computer's screen show what's coming next and the controls. Each display can then have its native resolution. This is a bit disconcerting, though, and it takes some practice. It may not be what you want.