Editor's note: Peter Bergen is CNN's national security analyst and the author of "Manhunt, the Ten-Year Search for bin Laden from 9/11 to Abbottabad", from which this article is, in part, adapted.
(CNN) -- On the sweltering evening of April 12, 2009, as dusk deepened over the Indian Ocean, several hundred miles off the coast of Somalia, three shots rang out. All the bullets found their targets -- three Somali pirates in a small lifeboat bobbing on the darkening sea.
For the past five days the pirates had taken hostage Richard Phillips, the American captain of the Maersk Alabama container ship.
President Barack Obama had authorized the use of deadly force if Phillips' life was in danger.
Unbeknownst to the pirates, days earlier a contingent from SEAL Team 6 had parachuted at night into the ocean near the USS Bainbridge warship, which was shadowing the pirates in their boat. The SEALs had taken up position on the fantail of the Bainbridge and were carefully monitoring Phillips while he was in the custody of the pirates.
One of the pirates had just pointed his AK-47 at the American captain as if he were going to shoot him. That's when the SEAL team commander on the Bainbridge ordered his men to take out the pirates.
Three U.S. Navy SEAL sharpshooters fired simultaneously at the pirates from a distance of 30 yards in heaving seas at nightfall, killing them all.
Obama called Vice Adm. William "Bill" McRaven, the leader of Joint Special Operations Command and of the mission to rescue Phillips, to tell him, "Great job."
In the eyes of Hollywood at least, the American public can't get enough of these kinds of operations. "Captain Phillips," a movie starring Tom Hanks playing the rescued sea captain, will be in theaters on Friday.
The flawless rescue of Philips was the first time that Obama, only three months into his new job, was personally exposed to the capabilities of America's "Quiet Professionals," as they sometimes refer to themselves.
They are the secretive counterterrorism units of special operations, made up of units including the Navy's SEAL Team 6 and the Army's Delta Force, whose well-oiled skills Obama has come to rely upon increasingly with every passing year of his presidency.
This was underlined over the weekend in Africa when operators from Delta and SEAL Team 6 carried out raids in Libya and Somalia -- more than 2,000 miles apart -- targeting a longtime alleged member of al Qaeda in the Libyan capital, Tripoli, and the leaders of one al Qaeda's affiliated groups in the Somali port of Barawe.
In Tripoli, Delta operators seized Abu Anas al-Libi, who is wanted for his alleged role performing surveillance on the U.S. embassy in Nairobi, Kenya, which was destroyed by an al Qaeda truck bomb in 1998, while in Barawe SEAL Team 6 operators went ashore to attack a house frequented by commanders of Al Shabaab, the group that launched the attack on the mall in Nairobi two weeks ago where at least 67 people were killed.
The Delta raid in Tripoli went off flawlessly, but the SEALs encountered heavy resistance in Barawe and the SEAL team retreated. Details of what exactly happened during the Somali operation are still murky.
The two raids over the weekend show that President Obama remains very comfortable deploying special operations forces in countries the United States is not at war with as a means to combat terrorist groups, just as he is comfortable with the use of CIA drones for the same purpose in countries such as Pakistan and Yemen.
For the White House, part of the appeal of special operations and drones is that they do not, of course, consume anything like the blood and treasure that are expended on conventional military operations such as the wars in Iraq and Afghanistan.
Indeed, the SEALS have had considerable experience working in and around Somalia in recent years. Six months after the rescue of Phillips, Obama's national security team authorized a mission to take out Saleh Ali Saleh Nabhan, a leader of al Qaeda in Africa.
Nabhan was killed by SEAL Team 6 in a helicopter raid on September 14, 2009, as he was driving south of the Somali capital, Mogadishu. The SEALs landed briefly to take Nabhan's body, and after they had confirmed his identity through DNA samples, he was buried at sea.
Home of SEAL Team 6
It is quite challenging to enter the SEALs, but an even greater challenge is to be selected for the SEAL's premier counterterrorism force, the innocuously named Naval Special Warfare Development Group based at Dam Neck, Virginia, near the bustling resort town of Virginia Beach.
It's known inside the military as "DevGru" and more popularly as "SEAL Team 6" and is an elite within the SEAL elite.
The men of DevGru, around 250 in total, are battle-hardened and are usually in their mid-30s.
DevGru is divided into squadrons that are named by color: Red, Blue and Gold are the assault squadrons, Grey handles vehicles and boats, and Black is the sniper team. These squadrons scout other SEAL teams, which number around 2,000 men, for those with the particular skills they need.
DevGru's base at Dam Neck does not announce itself. Behind the high wire fence that seals the SEALs off from the rest of the world is a large dog pound where the highly trained dogs that accompany the men on their missions live. There is a giant wall to sharpen climbing skills and a hangar full of exceptionally fast boats. Other hangars house experimental Mad Max-like dune buggies suitable for driving in the deserts of the Middle East and weapons rooms loaded with exotic firearms.
SEAL Team 6's greatest coup, of course, was the 2011 operation in Abbottabad, Pakistan, in which Osama bin Laden was killed.
However, SEAL Team 6's integral role in the war against al Qaeda and its allies would not have been easy to predict before the 9/11 attacks.
Just recall the debacle that has come to be known as "Blackhawk Down." In Mogadishu, Somalia, in early October 1993 a daytime helicopter assault -- by pilots of the Special Operations Air Regiment and elements of SEAL Team 6, Delta Force and the 75th Rangers -- to snatch Somali clan leaders who were attacking U.S. troops stationed in Somalia turned into a fiasco in which two Blackhawk helicopters were shot down by rocket propelled grenades. Eighteen American servicemen died.
Scarred by Mogadishu, the Pentagon was resistant to using SEAL Team 6 and Delta to take on al Qaeda in Afghanistan once the terrorist group had rebased itself there in 1996.
Indeed, after the 9/11 attacks, then-Secretary of Defense Donald Rumsfeld was deeply frustrated that the first American boots on the ground in Afghanistan were from the CIA and not the highly trained counterterrorism units of SEAL Team 6 and Delta Force.
On October 17, 2001, ten days after the U.S. campaign against the Taliban had started, Rumsfeld wrote a secret memo to Gen. Richard Myers, then-chairman of the Joint Chiefs of Staff, expressing his irritation: "Does the fact that the Defense Department can't do anything on the ground in Afghanistan until CIA people go in first to prepare the way suggest that the Defense Department is lacking a capability we need? Specifically, given the nature of our world, isn't it conceivable that the Department (of Defense) ought not to be in a position of near total dependence on CIA in situations such as this?"
Officials working for Rumsfeld commissioned Richard Shultz, an historian on special forces, to find out why special operations units were not deployed to hit al-Qaeda before the attacks on New York and Washington. After all, fighting terrorists was why these units were founded in the first place. Schultz concluded that in the years before 9/11 the senior officers at the Pentagon had become "Somalia-ized."
Then-special operations boss Gen. Peter Schoomaker recalled, "Special operations were never given the mission. It was very, very frustrating. It was like having a brand-new Ferrari in the garage and nobody wants to race it because you might dent the fender."
The attacks on the World Trade Center and Pentagon allowed Rumsfeld to push special operations to the center of the "Global War on Terrorism." And on September 6, 2003, Rumsfeld signed an order known as an "EXORD" that empowered Joint Special Operations Command to hunt al-Qaeda in as many as 15 countries.
Wife: Captured 'most wanted terrorist' al Libi had left al Qaeda
Military's own army
In the decade after 9/11, JSOC became a small army within the military with its own drones, its own air force (known as the Confederate Air Force) and its own intelligence operations.
The rise of JSOC was inextricably linked to the vision of Maj. Gen. Stanley McChrystal, a brilliant workaholic from a military family who was beloved by his men; during the Iraq War he who would go out with them on missions to capture/kill insurgents.
It was McChrystal who took the special operations Ferrari out of the garage and drove it to become a killing machine of unprecedented agility and ferocity.
JSOC went from mounting half a dozen operations a month in Iraq in the spring of 2004 to 300 a month by the summer of 2006.
It was McChrystal's five-year command of JSOC between 2003 and 2008 that helped turn its core components of SEAL Team 6 and Delta into what is arguably the most agile and deadly force in history.
One of the key officers under McChrystal was Bill McRaven, who took over command from McChrystal as head of JSOC when McChrystal went to take a senior job at the Pentagon.
McRaven is a strapping, dark-haired, blue-eyed Texan in his mid-50s. In conversation as he chugs a Rip It -- a heavily caffeinated beverage popular with American soldiers in Afghanistan -- he speaks in well thought-out paragraphs, but he also peppers his speech with the occasional "doggone," as well as other, more robust swear words.
A battle-hardened colleague says McRaven reminds him of the comic book superhero Captain America, while another says he "is reputed to be the smartest SEAL that ever lived. He is physically tough, compassionate and can drive a knife through your ribs in a nanosecond." Even as a three-star admiral, about once a month in Afghanistan, McRaven went out with his teams on snatch-and-grab missions.
It was McRaven who planned the bin Laden raid down to the last details. Now he commands Special Operations Command, or SOCOM, which oversees special operations by the Navy, Army, Air Force and Marines.
According to its mission statement, SOCOM's job is to "synchronize planning of global operations against terrorist networks."
A sign of where the Obama administration is placing its bets about what it believes to be the future of warfare is that while there are major cuts planned for all four of the armed services, SOCOM is one of the few places in the military where the force is actually growing.
Follow us on Twitter @CNNOpinion.
Join us on Facebook/CNNOpinion.