What are the functions of black boxes in aviation accidents?

Exploring the working mechanisms of black boxes in airplanes.