If you want to learn more how these things work I'd highly suggest going through the PoC||GTFO archive (https://github.com/angea/pocorgtfo/blob/master/README.md) and check out entries by Ange Albertini or entries named like "This ZIP is also a PDF".
"This file, pocorgtfo19.pdf, is valid as a PDF document, a ZIP archive, and a HTML
page. It is also available as a Windows PE executable, a PNG image and an MP4 video, all of which have
the same MD5 as this PDF."