An American flag is prepared for presentation to the next of kin
The flag is folded and is presented to next of kin, "As a representative of the United States Army, it is my high privilege to present you this flag. Let it be a symbol of the grateful appreciation this nation feels for the distinguished service rendered to our country and our flag by your loved one." (Generally, the flag is given to the next-of-kin as a keepsake after its use during the funeral service. When there is no next-of-kin, the flag is presented to a friend making a request for it).
The flag for someone who dies during active duty is provided by that individual's branch of service. The U.S. Veterans Benefits Administration (VBA) provides a U.S. flag at no cost, to drape the casket or accompany the urn of a deceased veteran who served honorably in the U.S. armed forces.