With Ford having a share of Mazda, much product sharing goes between the companies, a very useful arrangement for both of them. This has helped Mazda to be competitive, despite it's relatively small scale of operation. 1,285,000 cars/LCVs were made in 2005 and 1,350,000 in 2008, for about 2% world market share.
Unlike many other auto makers, Mazda has increased local production at the expense of overseas car making. Japan made 67% of the vehicles back in '05, but is now 80%! As to why this shift has been made and if it will continue in that direction, I do not know. I wouldn't have thought it the way to go if you want to be a global player.
Car making by country for '08:
Japan 80% 1,075,000
China 8% 105,000
USA 6.7% 91,000
Thailand 3.6% 48,000
Rest 2% 27,000
The heavy reliance on Japanese made cars isn't good. Japan traditionally kept the Yen low to help manufacturing, but the US downturn saw money fleeing to Japan like a tidal wave. The Yen soared and Japan suddenly was not a good place to make cars. Mazda must have felt that badly. Too many eggs in one basket is never a good idea. The cars themselves are sporting and different, but not as robust as some other Japanese brands. On the Japanese market, Mazda is a minnow, with less than 5% of the domestic market, and slipping.
The bottom line: If not for Ford, Mazda would be really struggling.