When an organism (such as an animal, or plant) dies, it has many substances that it absorved from the ecossystem throughout its life; these substances are usually transformed into stable forms inside the organism in order to be used into biological processes.
The decomposition is a process in which various factors (biotic and abiotic) break down the components of the remais of the dead organism, and liberate them back to the ecossystem (this is called nutrient cycling). This process is fundamental to the preservation of life in the ecossytem, otherwise its resources would be quickly depleted.
Many organisms are specialized in decomposing other organisms. Good examples include Fungi, Bacteria, some animals (specially insects) and many more.