Generally, smoke comes from incomplete burned fuel.
Normally, a jet engine burns a very lean mixture (due to turbine temperature constraints). Nevertheless, getting all the fuel to burn is a considerable challenge, primarily because the air/mixture flows faster in the engine than the flame front. So in order to provide stable burn, many tricks come into play: the combustion chamber expands after the compressor; there are special vortex generators that force the mixture to backflow and circulate; the air may be fed in stages along the chamber, etc.
This complicated gas dynamics is difficult to optimise, especially in the 70s when MiG-29's engines (RD-33) were designed. What usually happens is that there are pockets of over-rich mixture in the combustion chamber, and the extra fuel decomposes due to high temperature before it has an opportunity to burn.
From what I know, RD-33MK got a redesigned combustion chamber (amongst other things), but what exactly the changes are is hard to say. I can speculate that the source of the original problem was that RD-33 had an early example of the annular combustion chamber, which was not well studied then. But the problem was bad enough to make MiG-29 more easily detectable in visual fight.