Starting around 1973, the relationship between Egypt and Libya began to sour. The two nations had actually proposed merging at one point, until Libyan leader Muammar Qaddafi criticized Egypt's actions in the October war of 1973, prompting Egypt to withdraw from the agreement. Libya had also strongly criticized Egyptian cease-fires with Israel in both 1975 and 1976. When Libya made an arms deal with the Soviet Union in 1975, Egyptian president Anwar Sadat accused Libya of supporting an Egyptian underground revolutionary front with Libya's money and Russia's guns. Things were not helped when a group of Islamic extremists called the Society for Repentance and Retreat killed a former Egyptian cabinet minister and planted bombs throughout Cairo. Sadat, already mildly paranoid, blamed Libya for these actions. Sadat also wasn't very happy about Libyan propaganda that portrayed him and his wife as "Antony and Cleopatra." The propaganda claimed that they lived a life of luxury, wanting for nothing, while normal Egyptians starved. Libya did not like Egypt not only because of ideological differences between the rulers of the two nations (Qaddafi had idolized the former Egyptian president Nasir, whose policies were quite Arab-centric in marked contrast to the much more moderate Sadat), but also because of Egyptian backing of the government of Chad's fight against rebels in the north of that country. The government of Chad had accused Libya of backing the rebels and Libya had reason to believe that the Egyptians were backing Chad partially so that Chad would be able to crush Qaddafi after finishing off the rebels.
With that backstory, it becomes easier to understand how minor border raids by one country or the other could lead to a major armed conflict. Which country started the border raids is unclear, since both accused the other of raiding and taking prisoners over their common border. When the raids began, however, Egypt began to prepare for a major attack by reinforcing their existing troops along the Libyan border near Sallum. The Egyptian government at first accused the Libyans of making up attacks by Egyptian warplanes, but eventually admitted without too much prodding that they were attacking Libya. The attacks were not intended for conquest, after all, but rather to keep an enemy at bay, thus making anonymity and surprise much less useful. Qaddafi's forces were outgunned severely. Egypt had at least twice as many troops who had training superior to the Libyans', and Egypt won clear victories at Sallum and El Adem. Although Libya did its best to defend its targets, its only real recourse was diplomatic. It complained about Egyptian aggression to the U.N., as well as the rest of the world community. Qaddafi also threatened Egypt publicly by announcing his intention to "strike in the depths of Egypt." These strikes would presumably be terrorist in nature, since the more traditional military strategies were not working very well for Libya by this point.
Tempers were eventually soothed, thanks in part to efforts by Yasser Arafat and other prominent Arab leaders. Egypt voluntarily stopped its attacks within a reasonably short period of time, possibly motivated by the cause of Arab solidarity against the "real enemy," Israel. It should also be noted, though, that Egypt claimed to be engaging in retaliatory strikes, so they probably believed that Libya had learned the lesson they were trying to teach. Also, later that year, Sadat went to Israel and established friendly relations with them, betraying the fact that he probably wasn't all that concerned with anti-Israeli solidarity. Libya was, though, and joined the list of "steadfast states" who came out firmly against Israel and anyone who supported them, whereupon Sadat contemptuously called Libya a "dwarf." Although it certainly wasn't the deciding factor, one can't help but think that the war in which the two states engaged earlier in the year may have had something to do with this particular rift.