Very quickly, part of it has to do with May's One Nation/Shared Society nonsense. Given the consistency in which the PM talks about this stuff, it is definitely something she's ideologically committed to, even if - like any good Conservative - she doesn't let principles get in the way of power and politics. And so, with nothing to lose in Stoke, her breeze through the Emma Bridgewater factory and saunter about The Sentinel's offices (both "non-political" Conservative-supporting outfits, coincidentally) during the most high profile and important by-election in decades burnishes them One Nation creds. For years Tories have opined about no-go areas, and here's Theresa May herself leading from the front and making the case that Conservatism is for everybody.
She wouldn't have done this if the Tories weren't expecting to turn in a creditable performance this Thursday, and there's every chance they could. UKIP are in long-term decline and have been since before last June's EU referendum, and if there's any justice the lying lies of Paull Nuttall will do for them this Thursday. Furthermore, the polls and deflating performance in local council by-elections suggest chunks of kipper support are returning to the Tories. As far as May is concerned, to hold on in 2020 all she has to do is carry on being the super serious grown up politician, keep her fingers crossed Brexit negotiations don't have a disastrous outcome, that Trump and the economy behaves themselves, and triangulate to retain those fairweather UKIP votes. Her Stoke-on-Trent trip is a field test for that strategy. If the Tories can take extra bites from the purples and improve their position vis a vis Labour, this will be the course she steers between now and the general election.