A hydrocele is a collection of fluid around one or both testicles inside the scrotum. This condition can be congenital (born with it) or acquired.
Regarding the congenital form - in males, the testicles lower from inside the abdomen into the scrotum through the inguinal canals. By the time an infant is born, the testicles are typically located in the scrotum and canals close around the spermatic cords. For some infants, the canal does not completely close and fluid can build up inside the scrotum. This process causes a painless swelling of the scrotum. The resulting hydroceles usually resolve on their own over the first 6 months of life.
The acquired form may occur in an older man who has sustained an injury to the testicles, epididymis, or spermatic cord.
If you or someone you know has swelling in the testicles, you should consult your health care provider to have an examination. Not all causes of testicular swelling are hydroceles and this symptom can represent other important health conditions of the male reproductive organs.
See this WebMD link for further information on hydroceles:
http://www.nlm.nih.gov/medlineplus/ency/article/000518.htm