My bike is just like that, if you run it every 2 weeks it starts straight off, if you leave it for 4 weeks it is a pig of a thing to start....
If tapping the carb with a hammer cures it then on many small engines it is likely to be a sticky float in the float chamber of the carb, stuck in the closed position, fuel evaporates/leaks out overflow when the engine is tipped up, tapping it unsticks it and lets the fuel get in

not sure of the internal anatomy of a 2 stroke (just re-read your post!) but could be similar problem I guess?
It happens to anything though. Many years ago (1976 I think!) my father bought a new Cessna 172. On the first flight out of our farm, the engine stopped... thankfully close to the runway! The cause turned out to be something that had been left in the carb when it was built (some sort of plastic bung I think) that was sucked over some inlet in the carb cutting the fuel off. The scary thing was that it had only just been ferried about 8,000 miles down from the USA by a ferry pilot.... including a lot of flying across water! And you won't find a more safety conscious industry than aviation ... so it can happen to anything (though hopefully not too often in aeroplane engines

)
I've got a new 6hp on order to use as an aux and I intend to use it a fair bit when I first get it just to run it in and make sure there are no gremlins there in case I really need it