for example, the market had help from the government when the railroads were built, the government created the interstate highway system, and even the good ol' stock market needs the government to throw scammers in jail to work properly.
But look at your "wonderful" example, the iPad.
Note that it is a wonderful product, but not necessarily all that groundbreaking.
It is the most successful tablet, but it isn't the first. It evolutionarily grew out of smartphones and laptops, both established technologies.
Solar, wind and other alternative energy sources are risky for private companies because they are at the bottom of the technology curve - it's really simple and easy to design a coal plant and the technology is mature. And the market won't supply alternatives unless the price for coal electricity reflects the pollution and other deleterious effects that go along with it. Which is why conservatives once came up with the "carbon tax".
if the market never needs help, then why do state governments like South Carolina have to make it more difficult for unions to organize in order to get factories to locate there?
The bald truth is that governments help make markets and participate in the market.