Well, not entirely its own - Shostakovich clearly modeled the work on the elegiac piano trios of Tchaikovsky and Rachmaninoff, the former dedicated to the recently dead pianist Anton Rubinstein, the latter dedicated to the recently dead Tchaikovsky. Shostakovich, too, dedicated his Trio to someone recently dead - his best friend, Ivan Sollertinsky. Writer, music critic, and polymath, Sollertinsky not only supported the extremely nervous Shostakovich emotionally during the worst years of Stalin's Great Terror, he also introduced him to the symphonies of Mahler - and thereby completely transformed him as a composer. When Sollertinsky died unexpectedly of a heart attack in 1944, the shattered Shostakovich decided to compose a work in his memory.
Writing the opening two movements took several months, but Shostakovich finished off the closing two movements in less than a week. "My 'creative process' reminds me of a too quick session with Onan's sin," Shostakovich explained in a letter to a fellow composer. "It's exhausting, not very pleasant, and at the end, there's a total lack of certainty that you've spent your time to any benefit." Despite the composer's reservations about his working habits, the Trio was well received at its premiere and won him the Soviet government's highest artistic award: the Stalin Prize.