Both gòng senses share the idea of 'placing something before someone in authority' — offerings laid before a god or ancestors, testimony laid before a magistrate. The
亻 on the left is the petitioner or suspect;
共 on the right is the formal joint act of presenting.