Most microwaves that need to have a vent outside are over-the-range microwaves that replace a venting hood in a kitchen. These microwaves serve to pull smoke and fumes from a range outside of a kitchen.
While some microwaves have options simply to filter the air and release it back into the kitchen, the best option is to vent the microwave outside. Even with a filter, particles from fumes and smoke can still get back into the kitchen. Over-the-range microwaves typically have fans that pull the dirty air in, and that air needs to be vented outside in order for the microwave's venting system to work properly.