Traffic inspection by ISPs (let alone sharing of collected data with third-party entities) in the EU is required to have a legal/technical basis and/or user consent, depending on what is being done and for what purpose [1]. Even attempts at blanket (meta)data retention for law enforcement agencies have pretty much been ruled illegal in the EU [2] and Germany [3].
What probably happened is your friends were torrenting, and some entity acting on behalf of copyright holders got their IP from public trackers/DHT. Then they came knocking to the ISP with a cour order, asking for information about the person behind that IP address, and the ISP gave them that [4]. Finally, the entity sent a C&D to your friends.
[1] - See the EU DPS' opinion on how the existing EU legal framework affets ISPs' data inspection abilities: https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELE...
[2] - See Directive 2006/24/EC, tl;dr https://en.wikipedia.org/wiki/Data_retention#European_Union
[3] - htps://www.bundesnetzagentur.de/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Anbieterpflichten/OeffentlicheSicherheit/Umsetzung110TKG/VDS_113aTKG/VDS.html
[4] - https://blog.raychenon.com/file-sharing-violations-in-german...