The laws that govern the hydraulics are always interesting ..
For how this works:
When the straw is filled with liquid and tipped over, the output would create a vacuum if liquid doesn’t flow through, so the rest of the liquid is drawn up until the pressures equalize