Both relationships are about submitting to one another. This section starts back in 5:21 with the statement, "submit to one another". Then Paul goes on to tell us how this principle is applied in different relationships. The relationships in this section do not seem to be ones you would think of as submitting to each other. Parents submitting to their children and masters submitting to their slaves does not seem to be the normal order of things. What is Paul trying to teach us in this section?
Paul tells us that children must do what their parents say, but this does not give parents unfettered control. Fathers are not to provoke their children to anger, which might mean explaining why his children are getting disciplined or not having rules that conflict. Even though the parent is not given unlimited control their role is clearly spelled out in other texts like Proverbs - where it says that it is the job of a parent to discipline and give instruction to their children and this is for their benefit. The parent submits to their child by doing what is best for the child.
Viewing relationships through the eyes of God can often turn everything on its head. Here we see that the master is told that he is a slave of God. This has implications for what the master can do and how far his authority goes. His authority only goes as far as God (his master) lets it go. This passage goes on to say that the master is to do "the same as the slave"! The slave is working for God and the Master is called to work for God too. The master is to do good, knowing that, as a slave of God, his actions are accountable to God. All of this takes the position and status of the master and turns it into service to God. Both the slave and the master are submitting to God and in so doing so are submitting to one another.
This principle of submitting to one another levels the playing field of position and status in this world. If we are bosses, pastors, professors, senators, or even the president, we are all slaves of God and should do good to those under us. God does not give special privileges to those with titles, degrees or status. On the contrary, He treats everyone the same. He will make things right in the end and will reward those who do good.