The Darknet protects itself by being more robust against attacks
Researchers have discovered why cyberattacks usually fail against the Darknet, a part of the internet that guarantees users' privacy and anonymity. This hidden network is used for sensitive and often illegal purposes such as drug trafficking or exchanging child pornography and can counter large attacks on its own by spontaneously adding more network capacity. Ref. Source 7d.
Saying that the darknet can repel attacks is like saying that darkness can repel light. Darknet is not its own entity, it is just everything that is not or cannot be accessed through normal means. If you can't just type its address in any internet browser bar then it is considered to be part of the darknet. As such attacking it doesn't do anything, you can try to overwhelm some information on the darknet, but all that has to happen to circumvent that is a new pathway open up. The darknet is like a funhouse with the mirrored hallways that you can't tell what is a path forward and what is a glass wall or a mirror. You can try to attack someone you can see, but if someone has control of the glass walls, all they have to do is change the paths and suddenly you are attacking nothing. Darknet is so big and so hard to access that they can move around easily to negate attacks.
The most simple example is a program on your own computer. It may not be a very useful example, but lets say you create a website on your computer, but always have your computer behind a private firewall that no one can access. That website would then be part of darknet. As a more practical example, lets consider a forward facing website (That means something available on the clearnet or the 'normal' internet), with a few hidden pages. While you were designing your webpage, you fiddle with many ideas and try many different things. You ultimately decide on one design you like, but leave the other files on the server that is hosting your website. You just don't put any links on your website to these pages that you think aren't good enough. These extra pages then become part of the darknet. With no links or references to them, no one knows they exist (Besides you). There is no way to easily access those pages, unless I know the file structure of your website and the server that is hosting it. As such you could hide child pornography on those pages, and we would never know, unless we directly type the address of that webpage, which has no links or references to it anywhere else on the internet (Clearnet or darknet).
There are things that are illegal in some countries but legal in others. For example drugs are not illegal in every country, but accessing a website that has a strange extension (Instead of .com, it is something like .me or .out) can be difficult. So in America you can't just buy drugs, but somewhere else maybe you can and so someone in the country sets up a darknet website to sell them.
However another example is China's strict control of information. In America information is free, and so we can create darknet website (Which are harder to block access to) with information that Chinese people can go visit to get caught up on current international affairs. A lot of the darknet is also just old and useless junk, like website that don't work anymore, but are still hosted on an old server. There are also a ton of traffic cameras and other devices hooked up to the darknet that aren't made for people to access, but if you can discover its address, you could watch traffic or CCTV cameras setup in a store or whatever.
The darknet is not only for illegal things, but most website that are purposefully built for the darknet are trying to circumvent some law. A lot of torrent trading (Illegal copies of games/videos/etc) happens on the darknet. However I would say almost 75% of the darknet is just stuff that is hooked up to the internet, but not designed to be easily accessible (Like the cameras). If you can discover the location and password, then you can control cameras. Also some people like to setup home networks with weird or difficult addresses and passwords that just have a bunch of inane files (Like address books, calendars, family pictures, etc) that most people don't care about, but that person wants to access remotely from wherever they are. These files are technically on the darknet because it is not indexed by any clearnet aggregator (Like google).