web application – How are websites hacked and modified?

I was reading an article about a website being hacked and the hackers putting a picture in the website. So they hacked the website and modified the HTML to show the picture. What type of attack is this? I know it is not XSS or SQLi so what is it? I just want to know what type of attack it is not actually how to do it.