For many years I owned a hay field, so I can relate to this phrase. If it rains while your “hay is down” the dampness reduces the forage value and even causes mildew and mold. I was lucky to live with dry summers and modern weather forecasts and still got rained on at times.
The origin and meaning come in one neat package:
This proverb is first recorded in John Heywood’s A dialogue conteinyng the nomber in effect of all the prouerbes in the Englishe tongue, 1546:
Whan the sunne shinth make hay. Whiche is to say.
Take time whan time cometh, lest time steale away.