From everything I've ever read about Dwight D. Eisenhower, the GENERAL, Ike was totally adverse to politicians. Sure, he was forced to deal with the political heavy hitters of WWII, like Churchill and FDR (not sure about Stalin). By all accounts his ability to deal with these types of personalities was perhaps his greatest asset. But, I never remember reading about Ike looking forward dealing with the political snake pit during the war, let alone pursue his own political career after the war. What changed? How did he go from a humble general completely focused on winning the war in Europe, staying out of politics whenever possible, to running for and winning the presidency?
I will try to keep this short (but it likely will be rather lengthy). Full disclosure: I'm writing my dissertation on a topic involving Eisenhower and my research has put him in a rather negative light - I'll do my utmost not to let that overly colour my answer.
Since the why is relatively more simple, I'll touch on that first. Eisenhower became president because both parties wanted him to run for them, he believed the Korean War was being mishandled, he thought he could win handily, he wanted to stop the expansion of New Deal type programs, and he worried that Taft Republicans would revert the U.S. to isolationism.
There's also the fact that he nearly won the NH primary despite not actually being a candidate at the time - so he believed (wrongly) that if he declared himself a candidate for the GOP, he'd win the nomination easily. There are more reasons, but these are some of the bigger ones. Another key factor was the simple point that Eisenhower really did not believe any one else could do what he believed needed to be done. He understood John Foster Dulles would likely lead foreign policy if the Republicans were elected, and Dulles's policies basically terrified Eisenhower. I could go on and on (and on) about their dynamic, but this basically covers why.
That answer also touches a good bit on "how" he changed positions. But you're absolutely correct in that Eisenhower never really lost his distaste for politicians and political thinking. This, and other issues, was part of why he and Nixon got along so poorly. He also hated campaigning, had real difficulty dealing with criticism of his handling of issues, and considered many of the duties of the presidency to be either below him or not really the job he wanted to do (thus his near constant tinkering with plans to split the Secretary of State post in two, somehow creating a Prime Minister, etc.).
The basic answer to this question is that Eisenhower believed he was needed to lead and protect the United States, in a multitude of senses. The corruption scandals of the Dems and other problems in their party meant they would be unlikely to win UNLESS Eisenhower ran for them. The GOP was likely to win the election without Eisenhower - Truman had too many vulnerabilities as did the Dems. This meant Eisenhower, who believed in containment as the safest means to conduct the Cold War, was confronted with an aggressive yet seemly isolationist GOP (with Taft and Dulles "running the show" on a liberation platform which Eisenhower knew implicitly contained the idea of using nuclear weapons more freely). Essentially, Eisenhower running meant he'd wring control of the winning party away from policies and peoples he considered disastrous, and be able to guide and protect the U.S., both from its enemies and itself.
As for why Eisenhower ran again in 1956, it's a similar answer but one which (I believe) undercuts the idea of a humble Eisenhower. But, in brief - Eisenhower could see no viable Republican successor, and was not about to risk Adlai Stevenson and the Dems taking over if he failed to run.
There are innumerable sources on this, but two that I think are helpful if you're new would be the Pach and Richardson book The Presidency of Dwight D. Eisenhower which is still good despite its age, and for something a bit more recent, Jim Newton's Eisenhower: The White House Years is fair enough.