The function of Viagra is relatively simple – it relaxes the muscle and increases the blood flow to the penis. An erection is nothing more than blood flow to the penis. When blood flow is weak so is the erection. If we increase blood flow we increase the strength of the erection and the ability to maintain it.