- Does this mean "Have a lot of kids"?
Yes. There is of course other Biblical instruction to multiply and fill the Earth, and the previous verse of this Psalm (127:3) reformulates the message :
Lo, children are an heritage of the Lord: and the fruit of the womb is his reward.
The following verses about arrows, children and contenders provide a practical reason for having a lot of kids at an early age.
- And to whom does the they refer to in the last sentence?
The pronoun refers to the children, but the assumption is that the children have grown to be adults in the context of "contending with opponents".
Note that in those days, adult simply meant old enough to take on adult duties such as marrying, managing one's own farm/business, etc – say, 15 or 16 years old. If the man had fathered five kids by age 21, he would be 36 by the time the youngest of those five turned 15 and thus would still be in the prime of his life. Not a bad age to have your kids old enough to come to your defence when there's a difficulty!
Note also that "court" is given as "the gate" in the King James and other versions:
They shall speak with their enemies in the gate.
The gate of the city was typically where both commerce and justice took place. So the Psalm is saying that if there's a difficulty regarding a business dealing or a matter of law, there's an advantage in having your loyal sons to back you up in the dispute – whether by the threat of their physical presence, or by the financial resources they can contribute, or by their loyal testimony.
There are plenty of internet resources for exploring the meaning of Biblical passages; of the many I looked through in researching this answer, this interpretation seemed the most useful.