Alfred was once a clerk at the British intelligence. One of his projects was Project Excalibur, a missile defense program of which he had half of the launch codes.
After leaving intelligence work, Alfred assumed a life as an ordinary domestic servant. He served Thomas and Martha Wayne since before their son was born, and helped to raise him.
When the Waynes were killed by a mugger, Alfred helped shelter the orphaned Bruce, and assisted him in his training to become a crime-fighter. Alfred was fiercely loyal to his master and would never betray him. Indeed, Alfred was like a surrogate father to Bruce; offering him guidance and advice when he could. He would continue to do so as well for Dick Grayson, Barbara Gordon and Tim Drake.
During his many trials, Bruce came to rely on Alfred as a source of advice and moral support, one of the few men with whom he shared confidences. There were also multiple times when Alfred came to the rescue of Batman.
Alfred was also an invaluable source of aid in all aspects of Batman's life, from keeping his home in perfect order, to helping him maintain his public facade as Bruce Wayne, and occasionally carrying out espionage and investigation on his behalf.
Alfred's secret service past came back to haunt him briefly, when he was forced to leave Bruce's employ without notice to help rescue an old colleague who had been kidnapped by Red Claw.