“And.” To keep the flow of the context, this verse should have been numbered Genesis 1:32 instead of 2:1, because in it God continues the work of the first week of creation. To make the creation story easier to understand, Genesis 2:4 should have been Genesis 2:1, and started the new chapter with telling the story of creation from another point of view.
“with everything that was in them.” The Hebrew word is tsaba (#06635 צָבָא), and it refers to an army. God uses it to refer to the organized and vast army of the stars (Deut. 4:19; 17:3), as well as the army of angels (1 Kings 22:19; Psalm 148:2). In Isaiah 24:21 it refers to the army of fallen angels. But the Hebrew does not have to have a militaristic meaning. It can simply refer to a huge organized number like an army. Here it refers to all the organized things in the heavens and earth, which could include the “organized” numbers of animals, fish, stars, etc.
One thing this verse clearly indicates is that God created things with inherent organization. He did not just throw the stars in heaven and see where they stuck. He created the swarms on earth and the vast array of stars in heaven to work together in an organized fashion. All of God’s original creation, working together, was “very good,” and it worked together in harmony. Every part in some way affected every other part. This organization and intimate interrelation was seriously affected by the Fall of man.