What does Deuteronomy 21:17 mean?
He has to recognize the true firstborn, the son of the wife he doesn’t love, and give him a double share of everything. That son is the first sign of his strength, and the rights of the firstborn belong to him. Deuteronomy 21:17 - Modern Text Bible
(The firstborn gets a double portion, no matter how the father feels about the mother. This protects the rights of the firstborn.)