Does a company have to buy a license for a technology if the technology was developed simultaneously? Let's say that a company A and a company B developed technology C at the same time, but company B applied for the patent first and ended up with the patent. Does company A have to pay a licensing fee to company B if company A can prove that the technology they're using was developed independently at the same time in court, or is it first-apply-gets-all? You can assume that this is in the U.S.
Before the AIA in 2012 both companies could apply for a patent and if one of the applicants thought they were both trying to patent the same thing they could initiate an interference proceeding. In that proceeding before the board, they each present their evidence as to date of conception and diligent effort from that point to the date of the first filing. The board decided which application went forward.
Now the U.S. is with the rest of the world in first-to-file. It doesn’t matter who conceived first unless one actually stole the idea from the other. There is a new derivation procedure to try to prove that. I don’t think it has ever yet happened.
One of the "simultaneous" inventors could publish the invention, putting into the public domain. If published before the other's filing date, it would theoretically prevent the other from getting a patent.
In any case a patent owner can stop the other from making their product or charge a royalty. There is a narrow case under the AIA where one company has been using a process that another later patents and can retain a limited right to keep using that process but can’t move or expand operations. This is called Prior User Rights.
If someone else has a patent, even if you both developed the technology at the same time, that's just bad luck for you: You will need a license to do any of the claims of the patent, even if you invented it yourself.
You could publish your invention before someone else applies for the patent, tell the patent office about it, and the other party might not get a patent because of prior art.
If you have a trade secret (like an invention that you tell nobody about but keep secret), I could make the same invention ten years later, get a patent for it, and very bad luck for you. You'd need a license for my patent even though you used it for years. And a trade secret cannot be prior art because it is a secret.