1. which generation?
2. 320i uses a bigger/more powerful engine than 318i. for previous generation (e46) the 320i uses a 2.2L engine while the 318i uses a 2.0L engine.
same case with 318i vs 320i vs 323i vs 325i vs 328i vs 330i etc, they are all 3 series, but the last two numbers usually represent the engine size used, although not necessarily similar as in the case above