Malware (Virus/Spyware/Software) can very easily enter your devices by visiting a hacked website, installing a hacked app, opening an infected document, photo, image or video.
Anti Malware technology is reactive, this means that only when new malware or new security issues become “known” it is listed in an anti malware database. Malware technology and anti virus technology is also in a constant “arms race” as cyber crime syndicates, nation state actors, illegal data vendors and all sorts of bad people (and bad groups) vie to obtain your data, passwords, user accounts and, well everything.
Some malware simply report your data, other types of malware encrypt all your files. There are numerous different types of malware, different agendas and many different reasons why someone would want to obtain your resources.
To try to prevent at least some stress, regularly scan all your devices (phones/pads/laptops/notebooks/desktops) for malware.
Here are some other posts, that may help you prevent problems: