Check the picture below.
liquid always take the shape of the container that contains it, so 25 cm³ from a beaker or pitcher or a curvy pipe dumped into another container, will always have 25 cm³ as its volume.
In this case it went from the cylinder to a prism, same 25 cm³.
notice in the picture, the volume of a green cube with those dimensions is just 1 cm³.