Generally, the RIAA and similar have a company that trolls for music to download. (There’s some controversy about this too, because in some jurisdictions to collect evidence for a lawsuit etc. you need to be a liensed private investigator, which this company was not.) They download stuff, collect the names of the files and IP addresses, and pass it on to the RIAA (or for movies, the MPAA).
In recent cases, some law firms have taken it upon themselves to chase down copyright holders and offer to sue on their behalf. One law firm in DC, IIRC, has sued thousands of John Does all over the country with one court case.
So almost never do they sue for downloads - just for uploads. Of course, for items like movies, where you use bit torrent, you are sharing for others to upload while you download. Even programs like Limewire will put your downloads into your share folder, so you may be sharing anyway; some of the programs indexed your entire drive to share all mp3’s unless you changed the settings. So you may be sharing unintentionally. That does not matter.
The RIAA etc. operate an extortion racket where they ask the ISP for who owns that IP record. Often, this is reliable information, so it’s not very often they sue a dead person, or a grandmother for downloading rap music. They offer a deal - pay us now, or go to court. As mentioned above, $3000 is a lot of money, but the current laws have been bought and paid for by RIAA/MPAA lobbyists and the penalties can add up to hundreds of thousands of dollars, plus tens of thousands for a lawyer (whether you win or not).
SOme ISP’s fight back and demand a subpoena to release your name. No problem, they file a “John Doe” suit - as mentioned above, they file one case ($350 for one filing fee) for thousands of Does together. A tame judge will sign the subpoena and they ask the ISP for your name, then drop the one Doe suit and refile against just you, and a couple hundred others whose names they got. If they had to file individually for every Doe at $350 then the extortion might not pay; but in blatant violation of civil procedure, most judges have not called them on this.
Once you are named, if you do not show up in court they get a summary judgement - you must pay, without the effort of them actually prsenting much of a case. If you fight back (Google “Jammie Thomas”) then they can do discovery, and this is when they can ask to see examine your hard drive etc. This is discovery for a civil suit, not the FBI breaking into your house and grabbing things. Ms. Thomas was blatantly guilty, but lied, wiped her hard drive, etc. They have date stamps, they can tell if the music was downloaded or ripped, and if it is different from what they downloaded. Keep in mind the “Oscar Wilde principle” - if you are guilty, it’s pretty stupid to demand to go to court. The only thing holding back Ms. Thomas now is that the judge has felt that hundreds of thousants in fines is inappropriate, despite what the law says.
Keep in mind this is a civil lawsuit, not a criminal trial. (Although they have recently bought an paid for the congresscritters to make such action criminal, thereby empowering the FBI to do their investigations for them for free.) In a civil trial, it’s whoever has the preponderance of evidence. They don’t have to prove beyond reasonable doubt you did it. They just have to prove you did so better than you can prove you didn’t. In civil suits, judges have seen ever weasel story - the “but I didn’t” convoluted excuses you pulled on your parents or teacher won’t work on the judge.
Child porn is a different matter - anything sexual and under 18 is a criminal offense (and if you are not sure it qualifies, do you want a public trial to find out for sure?) with severe consequences, inculding registering as a sex offender for the rest of your life.