By the late 1960s, both Volkswagen and Porsche were in need of new models; Porsche was looking for a replacement for their entry-level 912, and Volkswagen wanted a new range-topping sports coupe to replace the Karmann Ghia. At the time, the majority of Volkswagen's developmental work was handled by Porsche, part of a setup that dated back to Porsche's founding; Volkswagen needed to contract out one last project to Porsche to fulfill the contract, and decided to make this that project. Ferdinand Piëch, who was in charge of research and development at Porsche, was put in charge of the 914 project.
Originally intending to sell the vehicle with a flat four-cylinder engine as a Volkswagen and with a flat six-cylinder engine as a Porsche, Porsche decided during development that having Volkswagen and Porsche models sharing the same body would be risky for business in the American market, and convinced Volkswagen to allow them to sell both versions as Porsches in North America.
Source: Wikipedia (original)