How do the actions of a flight captain influence the outcome of an air crash investigation?

I want to understand the role and responsibilities of a plane's captain during emergencies and how their decisions are analyzed in crash investigations.