One of the differences between Afghanistan and Iraq is that Afghans are more aggressive in defending their homes (which tend to be walled compounds, looking, and acting, like little forts.) Thus when American troops, especially Special Forces, go after a Taliban hideout, and raid an Afghan compound at night, non-Taliban neighbors will tend to grab their weapons and either open fire on the unknown raiders, or even come outside with their weapons ready. This is a fatal mistake against Special Forces troops, who reply to the appearance of unknown civilians carrying guns, by shooting them down. This is done with single shots, and the first shot rarely misses.
The Afghans are not accustomed to this degree of efficiency, and are more uptight about the sanctity of the home. After all, there is a social code in Afghanistan that obliges a home owner to show hospitality to anyone (well, just about anyone) who comes to their house, and to defend the house, and any guests within, with violence. So while these raids often get the Taliban personnel being sought, they will often kill as many innocent, but armed, civilians rushing out of nearby buildings to defend the neighborhood against bandits, feuding tribesmen or whatever. This aggressive defense usually works against other Afghans, but not against the more deadly Americans.
The U.S. has yet to come up with a solution to this problem. The raids have to go on, otherwise the Taliban get a free ride when it comes to nighttime hideouts. Daytime attacks tend to lose the element of surprise. Even with the deadly side effects, the night raids continue to be productive.