Swollen lymph node with hemorrhoids?

Since having children, I typically get a hemorrhoid about once every 3 or 4 months. They’re uncomfortable, but never excruciating. My question is: why do I always end up with a swollen lymph node in my groin when I get hemorrhoids? They go away as soon as the hemorrhoid clears, so I assume they’re related, but Google was no help. Thank you!