Water in trunk after heavy rain

Does it happen only while it sits or only if you drive it in the rain?