It's interesting how an open source product has a commercial version, nice business strategy to get market penetration!
How did Magento create an commercial Enterprise version when magento is open source?
Don't they have to release the commercial versions source code for free then?
The open source version of Magneto is licensed under the Open Software Licence. I'm not familiar with the OSL but it is a "copyleft " licence similar to the GPL (or, according to Wikipedia, more like the LGPL ).
The basic premise behind copyleft licences is that source code should be provided to anybody who receives the software. However, just because Magneto is released under the OSL, doesn't mean it can't also be released under some other non-open licence. You or I could not take the open source version and create a closed source fork because we are bound by the terms of the OSL, but the original copyright holders can. They are free to provide the software to one group under the terms of licence A and to another group under the terms of licence B. This "dual licensing" is quite common for open source projects.
There are many software products which use this way of dual licensing. As long as the company wrote all the source code by themselves, they can license it in as many ways as they like.
Things get more complicated when strangers contribute new code to the open source version. This submission is usually exclusively licensed under the open source / copyleft license, so the company is not allowed to use it within their closed source premium version. To use it anyway, they have to either
I think the first three options are quite common. I recently read a really good book about it but I forgot the title, and as far as I remember there is no English version of that book available (only German).
EDIT: See this question and it's answers, they pretty much tackle the same problem: Make my failed Web application open source?