SELECT * table_name;
returns all the data stored in that table. This leads to performance issues. Suppose you have a table with 10 rows and 10 columns and you want to get the data of one column (10 entries), in this case, you fetch only that particular column, you have to process only 10 entries but if you use select *, you have to process 10*10 = 100 columns. This drastically affects performance.
Now think of a situation where you have a website and you are displaying the contents of a particular table on the website. Suppose there are confidential and non-confidential data and you only want to display the non-confidential data on the website. In this case, if you use select * and send all the data to the website and then filter what data to display, this might lead to vulnerabilities where a hacker can steal the confidential data.