Water has a surface skin. Some insects are able to generate tiny bubbles under their bodies which makes them buoyant enough to not break thru the water's skin. This skin is also known as surface tension. Some bugs and small objects (pins or paperclips, etc) can rest on the surface of the water due to surface tension. Water molecules are bipolar and attract each other forming a skin. The bug or paperclip make tiny depressions in the water skin which provides buoyancy. A detergent will ruin the water tension (because it is a wetting agent) and the bug or paperclip will sink.