Confocal Fluorescence Microscopy and 2-photon Fluorescence Microscopy are two techniques commonly used in neuroscience to image only one plane of the sample and thus increase resolution. However, how they achieve this technically is distinct.
Confocal (confocal laser scanning microscopy (CLSM))
In confocal microscopy the sample is scanned with a laser in X and Y coordinates and fluorescence is recovered by de-scanning the emitted photons. To select photons emitted only in the imaging plane (focal plane), a pin-hole restricts the collection of the emitted light allowing only the passage of photons emitted in the plane one is currently imaging.

This image exemplifies how emitted photons (dashed red beam) originating outside of the focal plane will be blocked by the pinhole before reaching the detector.
This has several consequences
1) The laser light will excite fluorophore which you are not imaging (because the emitted photons are blocked by the pinhole). This bleaches your sample below and above your imaging plane while you are not collecting information from those planes.
2) The emission path has to be de-scanned in order for the pinhole to work. This long path from the emission to the detection of the emission photons means that you are loosing some precious emission photos.
2-photon Scanning Laser Microscopy
In the case of confocal microscopy excitation is achieved by the acceptance of 1 high energy photon. However, in 2-photon microscopy, two photons of half the energy are used to excite the fluorophore.

This introduces a non-linearity that has the following immediate consequence : if you need to 2-photons to coincide on the same fluorophore to excite it then you will only excite molecules of flurophore in a small volume of space in which the intensity of the laser is sufficient. Then since the excitation of molecules is limited to a small volume in x,y,z.

This image shows the difference between excitation when done with single photon (left) and 2-photon (right). Black is the areas where the excitation took place. As you can see on the left the single photon excitation excites planes below and above the imaging plane.
Then 3 things happen
1) You can restrict your imaging to a plane without the need of adding a pinhole. In Confocal the pinhole restricts the passage of photons emitted from planes other than the imaging plane. In 2-photon your effective excitation is already restricted in the Z plane, so the emission will also be restricted to this plane.
2) Since you now don't need a pinhole, you don't need to de-scan the emission. This means you can put your detector (Photon Multiplier Tube: PMT) very close to where the emission happens. Now you want all the photons you can get, because they all come from your image plane!
3) You are not bleaching other Z planes of your sample, because the intensity in other planes is not enough so that 2 photons excite the fluorophores.