WASHINGTON — The first time Senator Patty Murray ran for local office, she was so embarrassed to ask people for money for her campaign that she and her husband held a garage sale. But her generous husband could not stop himself from giving away an expensive lawn mower, she said, leaving the fund-raiser at a net loss.

By the time she ran for the Senate in 1992, she had gained the confidence to hold out the hat enthusiastically.

“I learned that you have to ask people,” said Ms. Murray, Democrat of Washington, adding, “The guys could go to the Chamber of Commerce. I went to the moms who had kids in preschool.”

For decades, female candidates lagged behind their male counterparts in fund-raising, largely because donors, most of them men, did not have faith in their ability to win. Women — the go-to donors for female office seekers — were historically more interested in giving to causes than to candidates.