Apple was historically a computer manufacturer. All the good computer manufacturers could see that the personal desktop and laptop computer market was going to start shrinking as alternative technologies became mainstream. Some of these companies completely exited the personal computing space (IBM selling off it’s computer division in 2005 for example), while others attempted to prepare for the future (Microsoft investment in virtual server technology and mobile operating systems back in 2000, 7 years before the release of the first iPhone).
Apple also decided to make a strategic decision to prepare for the future. They decided at the time to take a 4-pronged approach:
Technology was the future. And the smartphone was the route to connect communication and technology together. Like all companies, Apple did make the iPhone for a profit. They also made the iPhone because they saw that phones would eventually become necessary, which would make them extremely wealthy, known and industry mammoths. There is no truly correct answer to this question, because you would need Steve jobs to answer, but he is dead.
Apple created the iPod before making the iPhone, this may have created a sensation for Apple, to merge something that in my opinion Apple mastered and merge that into a product of the future, the SmartPhone. Before Apple created the iPhone they made a phone with Motorola, the Roku. This phone was not a massive success, but might of steered Apple in the right direction. Apple made the first iPhone for people who were sick of the gimmicky features that were in the others, but obviously the touchscreen was a gimmick at the time. The first iPhone lacked masses of features which people liked, but because of apples advertising and marketing strategies they eventually would become one of the most popular smartphone brands.
People could speculate and say that the illuminati were behind apple, they are from the future or whatever, but Apple would likely of made the first iPhone because they new something that few other brands knew, that the smartphone was a hidden gold mine, awaiting to be found, and well Apple is the miner.