Many people think their websites are attacked because somebody makes some malware just for the sake of crashing website, that could not be further from the truth. Malware is typically created to generate a financial gain for another website.
FINANCIAL GAIN FROM YOUR VISITORS
Some malware wants to infect your visitors computers and steal their financial information so they can go after their financial accounts and take their money.
BLACKHAT SEO SPAM TACTICS
This is the most common reason and in most cases is more lucrative for the attackers. The malware will use your website as a host to try and direct your users to other websites, these industries are typically fashion, gambling, porn and others. Some times these links are visible and sometimes they can’t be seen because they are trying to hide the links so they will not be discovered and use what is called “link juice” to benefit the attackers website.
In many cases the beneficiary of the attackers efforts are legitimate businesses that paid a company to conduct an SEO Campaign for them to help drive traffic to their website and they are unaware that the place they hired to do this work are getting good results by doing what are called “Blackhat Methods” by purchasing this type of link creation and malware tactics to benefit the other website. Their can be short term gains from this for the legitimate business but they will most likely get penalized from the search engines once it is detected that this is being done.