check the picture below.
now, bear in mind that, the volume of a pyramid is (1/3)Bh, in this case, their height is half of "h", or half of that of the rectangular prism.
anyhow, the combined volume is 2 times that much, let's check their ratio.
[tex]\bf \cfrac{\textit{volume of two pyramids}}{\textit{volume of prism}}\qquad \cfrac{2\left( \frac{1}{3}B\cdot \frac{h}{2} \right)}{Bh}\implies \cfrac{\frac{2Bh}{6}}{Bh}\implies \cfrac{\frac{Bh}{3}}{Bh}
\\\\\\
\cfrac{\frac{Bh}{3}}{\frac{Bh}{1}}\implies \cfrac{Bh}{3}\cdot \cfrac{1}{Bh}\implies \cfrac{1}{3}[/tex]