1) that win9x and win2K are not the same code-wise - isn't there some difference between nt and 9x?
2) that xp was the first rewritten win version for a long time
Let me answer those in reverse:
Windows XP Home and Professional are both based on the NT Kernel, which has progressed from NT to 2000. So, the home version will now use the same type of kernel that has been in the professional versions for some time.
Now, there is a difference in the underlying code between the 9x family and the NT/2000/XP family. However, that will not affect code written for a particular program, whether it be run on either 9x or NT. Even though the basic operating systems are different, the API's are the same. So, if a programmer writes a game, for example, up to Microsoft's DirectX specifications, then a coded function in the program (say "DrawTriangle()") will do the exact same thing under Windows 95/98/ME/2000/XP, provided they have the same version of DirectX.
To perhaps oversimplify the meaning of the term, this is what is known as "abstraction" in programming. That is, you write code for an abstracted or generic machine, and the different machines will take care of the specifics.
This is why a cleanly written spreadsheet program will run on all versions of 9x and NT, and a properly written DirectX game will run on every Microsoft OS that has that version of DirectX.