In the united-states the heart of COPPA is 15 U.S. Code § 6502. This section requires (in sub-section (b) (1)) that:
(A) ... the operator of any website or online service directed to children that collects personal information from children or the operator of a website or online service that has actual knowledge that it is collecting personal information from a child (defined as a person under age 13)—
(i) to provide notice on the website of what information is collected from children by the operator, how the operator uses such information, and the operator’s disclosure practices for such information; and
(ii) to obtain verifiable parental consent for the collection, use, or disclosure of personal information from children;
It also requires (in subsection (b) (1) (B)) any such website operator to provide a description of personal information (PI) collected and to permit a child or parent to refuse permission for further use or collection of such PI.
subsection (b) (1) (C) prohibits requiring more PI to be submitted than is "reasonably necessary" for a child to participate in a game or other activity, or be eligible for a prize.
subsection (b) (1) (D) requires an operator:
to establish and maintain reasonable procedures to protect the confidentiality, security, and integrity of personal information collected from children.
Nothing in COPPA requires any content to be labeled as "for children" or as "not for children". Marking some content, or even an entire site, as "not for children" is evidence that the site is not "targeted at children" and so may avoid the operator being required to comply with 15 USC § 6502. In addition, other US laws, not part of COPPA, prohibit knowingly furnishing to a minor sexually explicit or otherwise "inappropriate" content, even when this is not legally obscene and would be protected when furnished to an adult. Marking content as "not for children" and attempting to verify age might help avoid application of such laws.
The Wikipedia article about COPPA says:
In 2019, the Government of the State of New York sued YouTube for violating COPPA by illegally retaining information related to children under 13 years of age. YouTube responded by dividing its content strictly into "for kids" and "not for kids". This has met with extremely harsh criticism from the YouTube community, especially from gamers, with many alleging that the FTC of the United States intends to fine content creators $42,530 for "each mislabeled video", possibly putting all users at risk. However, some have expressed skepticism over this, feeling that the fines may actually be in reference to civil penalties, possibly intended for the site's operators and/or warranted by more serious of COPPA violations or specific cases of "mislabeling videos." (citations omitted)
This WGN news story "All You Need To Know About COPPA On Youtube" includes a link to an interview with Peder Magee, a Senior Attorney of the FTC’s Bureau of Consumer Protection. Magee says in the interview that recent actions under the law were for failing to properly handle PI collected from children. At time 5:02 Magee says "...and if you are collecting personal information [from children] you may have to comply with the law".
COPPA does not make any content "illegal". What it prohibits is collecting excessive PI from children, not obtaining consent for collecting PI in some cases, or refusing to delete such PI on request. If a site does not collect any PI from users, 15 USC § 6502 simply does not apply to that site.
Website operators may choose to restrict the access of children to avoid possible applicability of 15 USC § 6502 and its administrative requirements. They have the option of providing access but complying in regard to any PI collected.
Note that COPPA is, in theory, applicable to non-US sites that are targeted at US users or collect PI from US users. However, according to the Wikipedia article:
in practice, the FTC has never (as of 2015) actually issued any enforcement action against foreign companies, and attempts to do so may be frustrated by the lack of jurisdiction.
Obviously, laws in countries other than the US are likely to be different.