I'm rather rusty on my Smartcard stuff but I'll have a crack at an answer anyway.
Smartcards are small embedded computers in their own right and so they do indeed use a very simplified OS. The 2 you mention are the standard ones.
They all have some standard capabilities that are not especially dependent on the OS. The ability to present a certificate, encrypt/decrypt some data, request a PIN, etc are all part of the smartcard specification. These features are accessed from a host computer via a standard interface library, generally PCSC.
In addition though, most if not all smartcards of the last decade are able to act as very simple general purpose computers and that is where the differences come. Java smartcards run an embedded version of a Oracle Java as an OS and use Java as the programming language, .NET cards use an embedded version of Microsoft .NET in a similar way. Originally, there were only "dumb" smartcards and Java based "smart" smartcards. Now I believe that the .NET ones are much more common.
Hope this helps.