The concept of death is a complex one to grasp. It tends to develop bit by bit throughout childhood & into early adolescence. Research shows that there are several factors that influence the development of death understanding, including biological, social, cultural, emotional & spiritual elements.
For toddlers, death has very little meaning. They may understand that death is sad, but are largely responding to emotions expressed by adults around them. Preschool-aged children are more engaged and often curious about death, asking "why?" and "how?" it happens. They typically view death as temporary or reversible.
School-aged children have a more realistic understanding & start to view death as permanent, inevitable and universal. A fully mature understanding of death is a substantial feat of cognitive development. Most children don't have a clear appreciation until 8 or 9 years old, with an adult-like understanding developing after about 12 years of age.
What children know & learn is grounded in what their parents teach them. This includes children's developing understanding of biology, the natural world & the concepts of death and dying. Studies demonstrate that first-hand experience & parent communication are important factors in children's development of a mature death concept. E.g. children who grow up in rural or farming communities, exposed to the natural life cycle of plants and animals, typically develop a mature death concept earlier than children raised in urban environments.
To foster a healthy understanding of life AND death, parents should ensure that young children have regular exposure to animals, plants and the wider natural world. Experiences with the nature promote children's understanding of biological concepts, such as life, growth and death. Conversations about death should be honest and without euphemisms, as these may confuse them. Media portrayals that address death frankly (e.g. The Lion King) may be valuable resources for teaching children the realities of death.
References: Longbottom & Slaughter 2018, 2016; Fender & Crowley 2007