MDF, or Medium Density Fibreboard to give it its full name, is just that, so as Dave says, it acts like blotting paper (like compressed sawdust!) – you can’t inherently waterproof something like that..
The wood element of plywood isn’t in itself waterproof, it is the glue between the laminations that gives it it’s water resisting properties which is why you still need to seal/paint it as with solid timber. GRP is effectively waterproof for model making purposes but is still susceptible to water damage on full size boats kept permanently afloat – the dreaded osmosis! Epoxy resin is more resistant than polyester though.
In fact I have heard it stated that nothing is truly waterproof – there are only degrees of water resistance. Even glass absorbs water over a period.
Colin