Geometrically, you can fit the pyramids into a prism.

I can show you how to do this later if you wish.

If you have a cone and pyramid with equal base areas and equal heights,

their volumes are equal.

This is because the cross-sectional areas of both at any intermediate height are equal.

(Imagine they were both empty containers and fill up with rain to the exact same height)

Calculus (calculation of volume) can also give a proof.