The section of the book of Joshua that you cited, chapters 14-19, details the division of the Promised Land among the twelve tribes of Judah after they have taken possession of the land under the leadership of Joshua. The tribe of Ephraim was made up of descendants of Ephraim, one of Joseph's two sons.
The territory assigned by lot, or drawing, to the tribe of the descendants of Ephraim is described in chapter 16, verses 5-9. The Ephraimites moved into the area that was given to them.
However they did not drive out the Canaanites that dwelt in Gezer; so the Canaanites have dwelt in the midst of Ephraim to this day but have become slaves to do forced labor. (Josh. 16:10)
This territory was in the central area of the land being possessed by the tribes of Judah.