While Costa Rica shares much of its history well into the 19th century with the other central American states (and in fact gained independence on the same day as Nicaragua, Honduras, El Salvador and Guatemala) which is still visible in the blue white blue basic flag of all these countries (Costa Rica simply added a red stripe in the middle of the white one), there are some notable differences. The most visible today is that in Costa Rica European settlement mostly occurred in the Central Valley, which led to it becoming the economic and political heart of the country and the ancestry decidedly European. While the political climate until the short civil war of 1948 (won by José Figueres Ferer, who would later be president for three separate times and is one of Costa Rica's most influential politicians) was not all that different from the rest of Central America (think coups and rigged elections) it has since bettered a lot and all elections since 1949 were peaceful and up to international democratic standards. One reason for this is that Figueres upon taking over abolished the military and Costa Rica is still one of only a handful countries without one, leading to fewer coups and more money for education and social programs. This however has led to Costa Rica being hugely influenced by the USA and being one of America's closest allies in the region.
In the 1980s almost all of Central America was embroiled in civil wars and shaky unpopular governments. Costa Rican President Oscar Arias Sanchez made a peace proposal that got almost all sides in war-torn Nicaragua to sit together and talk and achieved a lasting peaceful solution and democratic elections in 1990. However Nicaragua-Costa Rica relations have deteriorated in recent years and dominated the political agenda of Arias Sanchez' second term in the 2000s. Rio San Juan, which belongs to Nicaragua but is situated at the border, became a hot button issue. One point of contention were Nicaraguan drainage operations on the river which Nicaragua claims was to ensure safe shipping, but Costa Rica claims illegally entered their territory (Nicaragua pointed to google maps in their defense). Another point of contention is whether Costa Rica has to pay a fee for tourist excursions on the river - Costa Rica claims an old treaty guarantees both countries free navigation of the river, whereas Nicaragua maintains the only thing the treaty says is that Costa Rican ships may transport "goods" without paying a fee and people are not, in fact, goods. The whole situation was made worse by Arias Sanchez' successor Laura Chinchilla who insisted on building a controversial highway right next to the river over Nicaraguan protests, which Nicaragua claims not only harms Costa Rican nature reserves but might also overload the river with sediment. The whole issue is further complicated by a number anywhere from several hundred thousand to a million Nicaraguans living in various states of legality in Costa Rica. They are not always treated all that well. However, signs of reconciliation are also made from both sides and a new bridge now crosses the Rio San Juan near San Carlos (Nicaragua) enabling overland transport towards Los Chiles and both countries do see each other as "pueblos hermanos" (brother peoples) if sometimes bothersome and annoying brothers.