The following is a picture of Peugeot 405 Oil Pan. As you can see, there is something like a flap inside the pan. Does anyone here know what is the function of that part? Why is the pan divided into 2 different chambers? Thanks in advance.
The flap allows oil to move freely in one direction and slows it down going the other. The free direction of flow is usually towards the oil sump pickup. This helps ensure there's a ready amount of oil for the oil pump to feed vital parts of the engine. NOTE: In your picture, you're pointing to the top portion of the device. It's actually the bottom which moves. The top part is stationary.
These are readily used in performance applications. The below image shows an add-in aftermarket baffle system from Holley which is used in a GM LTx engine oil pan. It completely surrounds the oil pump pickup, allowing oil to freely enter, but slowing down its escape, only doing it from all directions. It is primarily advertised for road racing applications where there are a lot of lateral G's from all directions involved (braking, speeding up, cornering). It can, however, be used on the street without detriment to the engine or oiling system.