If you're plugging a device with a 2-prong plug into an extension cord that has 3 prongs on the other end, does that give it the grounding benefit of the third prong?
No. If the two prong device is fairly modern, it is sufficiently insulated in its design so that it does not need a separate grounding line (these devices were often referred to as double insulated). It means that the designer has ensured that it is highly unlikely that a consumer can come in contact with a hot lead in the device.
Many modern devices are polarized (one of the prongs is wider than the other) to ensure that the correct part of the device is connected to the hot side of the circuit. This helps ensure safety.
For all of these type devices, a two wire/prong extension cord is adequate, assuming it is rated for the wattage being drawn. This is a function of both the amperage of the tool and the length of the run.
When you plug a two prong device into a three prong extension cord, the device is not connected in any way to the ground wire in the cord. There is no downside in this arrangement, but a two wire/prong extension would do the same thing.
There are older two prong devices that do not have adequate grounding and pose some risk if the device is damaged during use, for example some older metal bodied electric drills. Unfortunately, using a three wire extension will offer no greater protection when used with a two prong appliance.
While we are at it, let us rail against the three prong-to-two-prong adapter. These units are intended to allow you to plug a three prong device into an older two prong outlet, and proper usage requires that you attach the grounding tab to the center screw in that outlet, bonding the adapter ground to the frame of the outlet body. This is often neglected. Much worse is the use of these adapters to connect a three prong device to a two wire/prong extension and no grounding is even attempted since none is possible. Even when used properly it may be "grounded" to an outlet that doesn't have a ground, and may actually be shorted to one of the current carrying conductors.
Throw these damn electrocution hazards away.