When parents separate, they must arrange where their children will live and what amount of time the children will spend with each parent. They must also arrange how they will make the major decisions about the childrens' care and upbringing. These arrangements are what the law calls "custody" and "access."
Usually it is the child's parents who make an agreement or apply to court for custody or access. But in some cases, other people might get custody or access, such as a step-parent, grandparent, or other relative. Or it could be someone outside the family who has a close relationship with the child.
Courts must make these decisions based on what is in the best interests of the child.