The secret of Ephraim and Manasseh

Were ALL the Israelites in Egypt? Why was there a need for three covenants: Sinai, Moab and Ebal? And what is the connection to Joshua's Altar?