Following the 1953 death of Stalin, one of the leaders jockeying for position as First Secretary of the Communist Party of the Soviet Union (which consisted of 15 socialist republics including Russia and has 15 successor states including Russia) was Nikita Khrushchev. (He had spent most of his early political career in Ukraine, though he was born in a tiny village that is now in Russia and was ethnically Russian).
His position was solid by 1956 when he gave the secret speech denouncing Stalin. By summer 1953 he and Malenkov had already removed Beria and later had him bumped off, but Khrushchev was also operating against Malenkov, his main opponent with a claim to the First Secretary job. His star was definitely rising and he was appointed First Secretary in September 1953.
It is surmised that he gave away Crimea (which had been in the modern period the Crimean Khanate and then since 1783 an imperial Russian territory and then part of the USSR) in the context of the power struggle that still lingered as long as Malenkov retained vestiges of power (until late 1954 and early 1955), to smoke out individuals still hostile to him and to gauge loyalty by sticking his nose out over Crimea. Or he may have needed support from his Ukrainian allies while engaged in the power struggle and it may have been a payback. Crimea was very much a plum spot to have control over -- nice weather and resorts available for patronage style politics.
Khrushchev had always had a plan to replace the Tatar population removed during WW2 with Slavs (this ethnic change was already under way in the 1930s but removal of the Tatars inspired bigger plans). He had a gleam in his eye about expanding Ukraine and it didn't hurt him politically to appear to be distributing largesse or to appear to be distancing himself from Stalin's policy of keeping a tight grip on every single part of the USSR or other aspects of Stalin's days in power that Khrushchev had been involved in up to his elbows (purges). So when his chance came, he used the 300th anniversary of the merger of Ukraine with imperial Russia as the occasion to make the gesture of giving Crimea to Ukraine. Nobody really knows for certain what was going on in Khrushchev's mind however; there are allegations that the whole business was debated and voted upon in about 15 minutes of a meeting in 1954 and that Khrushchev had given the impression that it was pretty much a whim of his.
Officially the proclamation of January 1954 stated it was a "Decree of the Presidium of the USSR Supreme Soviet transferring Crimea Province from the Russian Republic to the Ukraine Republic, taking into account the integral character of the economy, the territorial proximity and the close economic ties between Crimea Province and the Ukraine Republic, and approving the joint presentation of the Presidium of the Russian Republic Supreme Soviet and the Presidium of the Ukraine Republic Supreme Soviet on the transfer of Crimea Province from the Russian Republic to the Ukraine Republic."