I want to add to what David's said, "The responsibility of allocating resources, be it human, money, tools, material, or time, rests with leadership." I think, though, the question might be more about what leadership. Does that mean a defined position, or leadership from within a completely self-organized team?
If you have a project manager or a product owner or Scrum master or however your team is organized, it is ultimately their responsibility to figure out who is working on what tasks when. That said, it's the responsibility of the person who's leaving (particularly if it's for an extended period of time, like maternity leave) to communicate the details of their absence to the project's leadership.
How do you do that? I'm a big fan of one-on-ones.
From "How to work maternity leave into your long-term projects":
These are not your regular individual meetings because the
communication needs to extend beyond tasks and deliverables to any
concerns about what will be taking place during the team member’s
absence, as well as any developments that require immediate
adjustments to the project schedule or priorities. Keep consistent
notes from these sessions, and bring in the appointed backup person
for any issues that they will need to be aware of or take over.
Those meetings will also help clarify how whoever is going on vacation or taking family leave is prepping for their time away from work. Just like with everything related to project management, communication is key, and I think that task ownership is a shared responsibility between whomever is leaving and whomever is responsible for the project, and failure comes from one side of the equation withholding information from the other.