Piles is just a mass of dilated and tortuous veins that occur in the anal canal. Simple fact and surprising, isn't it?
These dilated veins arise from under the mucous membrane in the lower rectum. They form a mass containing several branches of veins which descend down the anal canal giving rise to piles. Such piles may be external (Present and visible at the anus) or internal (within the anus and required internal examination to confirm its presence) to the anal orifice.
The external type is covered by skin while the internal is covered by mucous membrane. Both of these may be present in the same individual. It is these dilated veins that cause bleeding, pain and other discomfort at the anus.