My company (me) has been working on a website for a client for some time.

I started to use a subcontractor to do some of the work.

Subcontractor works directly with the client, but invoices me. I mark this up and invoice the client.

All the while, I am on hand to answer subcontracor's in-depth questions about the operation of what is a very complex site. So they are learning more and more about the site. Learning about the operation and having easy access to the rather clever (I think) code I wrote.

In under a year, the paperwork the subcontractor signed to say they wouldn't compete with me for my client's business for a few years expires.

Is it fair/normal/expected in such circumstances that the subcontractor ends up undercutting their employer and working direct for the client?

There is no contract, verbal or otherwise, in place at all between my company and that of the client. I seem to recall reading that there is some greyness as to the actual ownership of the code originally written.

Realise this is probably a HUGE subject area but don't know where to start really. Thanks for any thoughts/advice.