In 1916 Bayerische Flugzeugwerke AG and Rapp Motoren Werke - two Bavarian aero-engine companies - were merged to form a new business called Bayerische Motoren Werke AG. In January 1917 Max Friz joined the company and designed the BMW IIIA engine, which was used in Fokker fighter planes in 1918. In June 1919 the Treaty of Versailles banned the company from building aero-engines and so Friz began designing motorcycles and engines for trucks.

Franz-Josef Popp, the owner of the company, started to look at ways of expanding and decided to move into automobiles and in September 1928 bought the Dixi company in Eisenach which was building Austin Sevens under license to the British firm. These soon badged as BMW 3/15s. The cars were developed by Friz and 19,000 of them were sold. Popp then demanded a bigger car and designer Alfred Boning created the 3/20. This was followed by the 303 which led to Friz's departure from the company after Popp decided to adopt Rudolf Schleicher's six-cylinder engine rather than a four-cylinder designed by Friz. There followed a series of models in the course of the early 1930s culminating in the 328 in 1937 which would dominate sports car racing in the years before the war with good performances at Le Mans in 1939 and victory in the 1940 Mille Miglia. It was the start of a long history in touring cars and sportscars with numerous successes.

BMW single-seaters were however rare. In the immediate post-war years the 328 was used by many German drivers as the basis for racing cars. These were known as BMW Specials (or BMW Eigenbau) which were raced with great success in Formula 2 events in the late 1940s and early 1950s. As these developed small car construction businesses sprang up using the BMW 328 engine and so the lines between BMWs and prototypes became increasingly blurred. The best known BMW engine users at the time were Veritas (until the firm started building its own engines), AFM (which went on to use the Kuchen V8) and Jicey. Eigenbau constructors included Marcel Balsa and most of the racers in East Germany, notably Paul Greifzu. By 1952 competition had developed so much in the West that the BMW Specials were largely out of date, although they continued to be very effective in the East. That year the World Championship was run for F2 cars and several BMW Specials turned up at international races such as the Eifelrennen and the Grand Prix des Frontieres at Chimay, Marcel Masuy finishing fourth in a Veritas-BMW. At the German GP Balsa and about a dozen others turned up to race in BMW-engined machinery with the Veritas chassis proving to be the most effective, allowing Fritz Reiss and Toni Ulmen to finish seventh and eighth.

BMW Specials continued to appear in races until F2 was canceled at the start of 1955. The new Formula 2 in 1956 was dominated by Coventry Climax engines while BMW's management was rather staid and steered clear of motor racing, despite the best efforts of Alex Von Falkenhausen.

In the late 1950s, however, a new management came to power and sporting programmess expanded with BMW beginning a remarkable series of victory in touring car racing. When the new 1600cc F2 regulations arrived in 1967 BMW produced an engine with an unusual four-valve Apfelbeck head in a Lola 100 chassis for drivers Jo Siffert and Hubert Hahne. The latter finished fourth in the Eifelrennen that year but success was rather limited and most of 1968 was spent developing a new car in association with Lola. The Lola-BMW 102s were driven once again by Siffert and Hahne and both led the team's debut race at Hockenheim. A few days later Siffert finished fourth at Albi. Hahne also drove a 102 at the German GP.

For 1969 there were new M12 engines in factory-entered Lola 102s for Siffert and Hahne with Gerhard Mitter, Dieter Quester and others driving a third car. In June the new Len Terry-designed BMW 269 chassis appeared for the first time with Quester driving it at Hockenheim. The Lolas were dropped and development began, although there was a setback at the German GP F2 race when Mitter's car lost a wheel and he was killed.

The program continued with Quester playing a more important role and he ended the year with second place in a mix-and-match race at Munich's Neubiberg airfield at the end of the year. There was further expansion in 1970 with four works cars with Siffert, Hahne, Quester and Ickx and a new BMW 270 and they all won races in the cars. Quester finished fourth in the European Championship and went on to win on the streets of Macau that autumn. For the final year of 1600cc F2 BMW did very little, supplying Quester with engines for his Eifelland March. BMW sat out the first year of the new F2 regulations but returned in 1973 supplying the March factory team, which was running Jean-Pierre Beltoise and Jean-Pierre Jarier, with customer engines for a variety of others including the Brambilla Brothers's Beta Racing Team and Brian Lewis Racing. Jarier won the European title and for the rest of the 1970s BMW supplied engines in F2 enjoying much success until F2 was canceled at the end of 1984. BMW also enjoyed much success with the Procar series in 1979 and 1980. The new boss of BMW Motorsport Jochen Neerpasch tried to convince the BMW board to enter F1 with a turbo engine but was refused and quit the company to work with Talbot. In 1980 BMW management was persuaded to change its mind by Neerpasch's replacement Dieter Stappert and the company announced that it would build a F1 turbocharged engine for the Brabham team. The engine was first tested at the end of 1980 and began racing in 1982, winning its first race with Nelson Piquet in Canada in June. The engines went on to score eight more wins in F1 and powered Piquet to the World Championship in 1983. At the end of 1986 BMW announced that it was withdrawing from F1 and the rights to the engines were sold to Megatron and continued to be raced in 1987 and 1988.

BMW Motorsport concentrated on touring cars once again although there were various attempts to return to F1. The company supplied engines to the successful McLaren GT programs in the mid-1990s but it was not until 1997 that the company announced a major new sporting initiative with Williams Grand Prix Engineering for sportscar and F1 racing. The Williams-BMW F1 cars were first raced in 2000 and it quickly emerged that the BMW engines were amongst the most powerful in F1. By 2002 the cars were highly competitive and but for some mistakes by the drivers the team might have won the World Championship in 2003. After that the relationship between BMW and Williams became increasingly strained and in the middle of 2005 BMW reached an agreement to buy the Sauber team. The new team was launched in January 2006 with drivers Nick Heidfeld and Jacques Villeneuve and test driver Robert Kubica.