Disclosed is a capsule designed to be used in an automatic beverage preparation and dispensing machine. The capsule includes a compacted aggregate of a substance to be infused and a packaging envelope impermeable to air and water. The packaging envelope is configured to hold the compacted aggregate of the substance in the interior of the capsule so that infusion is carried out in the interior of the capsule. Also disclosed is a method comprising piercing the packaging envelope of the capsule, using a piercing device of an automatic beverage preparation and dispensing machine.