The fungal group known as the basidiomycota, like most fungi, exhibits alternation of generations. This means that during one part of the life cycle known as the sporophyte stage, the organism's cells are diploid, or 2N, meaning that each cell has two copies of each chromosome. The basidium, or fruiting body - what you would call a mushroom - is diploid. When the basidium forms spores, it does so by meiosis, which means that each spore is haploid, or 1N, and has only one set of chromosomes.
The haploid spores fall out of the basidium and eventually land somewhere. Each sprouts into a haploid hypha, a threadlike strand of fungus. This is the gametophyte stage of the life cycle. Two hyphae will fuse and join their chromosomes into a diploid zygote, which matures into the basidium, which undergoes meiosis to create more haploid spores and begins the cycle again.