America wanted Egypt to be its ally. But Egypt and America didn't always agree. Egypt nationalized the Suez Canal which caused a lot of tension between the US and the USSR. Because the US backed Israel, Egypt embargoed oil with OPEC.
Egypt became the USSRs ally instead of a US ally. The USSR supplied Egypt with weapons and economic support. There was a war between Egypt and Israel. Egypt was backed by USSR and Israel was backed by US. Egypt lost.This severed the ties between USSR and Egypt.
Egypt shifted from the USSR as its main supporter to America. Egypt felt that the USSR couldn't help Egypt This allowed America to begin to keep Soviet Russia from peace projects in the Middle East. This caused temporary peace in the Middle East. This also created an alliance between US and Egypt.
Egypt wanted weapons to protect the suez canal. America was reluctant to give weapons to them but they it to them anyway. When the suez canal was nationalized they used the money to make the aswan dam. It took several tries to make the dam. They wanted to protect the canal from bad people with these weapons that they got.
Now America and Egypt are allies. America helps Egypt with economy and military. These two countries are mostly military allies. Because of many things that happened Egypt now is not as violent towards Israel. They are more trusting of the west.