1) Software source codes are protected by copyright, not patents. Copyright is granted automatically when an idea is expressed and lasts over 100 years. It restricts copying, distribution, and creating derivative works without permission.
2) There are various open source software licenses like the GNU GPL, GNU LGPL, and BSD licenses. The GPL requires derived works to also be open source while the LGPL allows linking to closed source software. Permissive licenses like BSD allow commercial use and do not require derived works to be open source.
3) When GPL licensed code is added to a closed source project, the entire combined work must be released under the GPL, becoming open source. Modifying GPL software without releasing the source is a