There are two sides to every coin. As silly as it sounds, the first side is the image.
Credit
Teens constantly see young and “cool” people using Macs. MacBooks have an image that is unparalleled. They are seen as quick and innovative regardless of what the truth actually is.
When students’ parents are paying over $30,000 a year for a college, an extra $1,000 computer is practically nothing; especially when that computer will be used for 4 years and the kid wants it.
Then you start to see classrooms like this and almost every college student is using a MacBook. Let me rephrase that. “Almost every [young and cool] college student is using a MacBook”. This contributes to the image which is a continuous cycle.
The second side of the coin is function. If you are going into the tech field, a Mac is basically essential.
Google employees either use Macs or Linux. PCs have actually been banned because of security breaches. At IBM, Macs are used almost exclusively. If you are going to be a developer, a Mac is basically the only choice. Most tech startups use Mac due to lower costs (yes, you read that correctly). If you are going into a tech company, a Mac is usually the device of choice.
Most scientific programs are better on Mac and Linux. As MacOS is UNIX-based, it is made for scientists and scientists used to be a core audience for Apple.
The last group is liberal arts. Liberal art majors tend to use Macs because of the ease of use. While Windows 10 makes Windows a lot more competitive, Apple still have the advantage with the non-tech niche.
In the end, Apple Macs have a very strong image among teens and parents are willing to buy a more expensive computer (short-term). Combined with it being preferred for most majors, it is an easy choice.