Fake antivirus malware is commonly known as scareware. Typically it is installed through malicious websites and takes the form of fake online scans. Cybercriminals attract traffic to these sites by sending out spam messages containing links or by compromising legitimate websites. Frequently they also attempt to poison the results of popular search engines (blackhat SEO) so that users access the malicious distribution sites when conducting a search.
Fake antivirus malware is financially motivated and is a big earner for cybercriminals. The large profits provide significant resources for investment into creation and distribution of fake antivirus. Hacking gangs are very good at rapidly producing professional-looking bogus websites that pose as legitimate security vendors.
Using up-to-date, legitimate antivirus or endpoint security software will protect you against fake antivirus software.