Typically, that's based on the email metadata such as the sender address, or mime types of the attachments as opposed to the actual content of the email.
Even simple tools like spam assassin read the body, and you can bet that almost any public provider is doing more than spam assassin.
Not to mention all kinds of actually free services. Think colab.