system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do torrent websites keep track of the seeds/peers of each torrent?

For example the pirate bay, you can filter results to show a torrent that has the most seeds etc. do they scrape the data for each torrent every time you search? Or do this periodically? For example if all the peers dropped from a torrent, you wouldn't want it to still show on the site as having lots of peers.
gpt
So a torrent has seeders (people who have the whole file and are actively sharing it) and leechers (typically people who download more than they upload). The collection of the seeders and leechers is called a swarm. Different torrent sites use a tracker to organise the swarm. The tracker is what detects the number of people seeding and leeching. So when you open a torrent your computer talks to the tracker and tells it which torrent you're after (downloading), or you tell it that you're ready to upload for someone (seeding).