The press/media is the fourth Estate, what are the second and first?
There are two quite unconnected concepts here.
One is the branches of government:
1. Legislature (parliament) which makes the law
2. Executive (government) which implements the law
3. Judiciary which adjudicates disputes in the law.
In principle, these should be independent. This thinking was formalised during the enlightenment, notably by Thomas Paine in the "Rights of Man"
My understanding is that whilst a free press is not formally part of constitutional government, it has been considered so integral to effective governance that it is referred to as the 4th arm or "estate"
Wiki provides some slightly different but related interpretations too ( clergy/nobility/commoners as alternative first three estates) [edited for clarity]