Hello and welcome to HealthcareMagic.
The short answer is Yes - the two can be related.
What you describe most suggests rectal hemorrhoids -
Hemorrhoids are swollen veins in the rectal/anal area.
External hemorrhoids can shrink when they heal and then again swell up causing a lot of pain and bleeding from the
rectum when they flare up. When they are swollen and painful we say that they are thrombosed - a blood clot has formed inside them.
The condition of hemorrhoids is chronic, recurring, but benign - not dangerous.
It is common in women who carried babies in their bellies and have given birth to children - all this caused increase pressure on the veins in the rectal area.
.............
I do not think from the description you have given that your condition is a
rectal cancer, but any "ball" or a "lump" near the rectum has to be examined by a doctor to make sure that there are no signs of cancer there.
I hope you find my answer helpful.
Regards and wishing you best of health.