Indexes support efficient query execution in MongoDB. Without indexes, MongoDB would need to scan every document in a collection to find matching documents for a query. Indexes store a small portion of collection data in an easy-to-traverse form, ordered by the value of specific fields. To create an index, the db.collection.createIndex() method is used, specifying the field(s) to index. Indexes can be single-field, compound on multiple fields, or multikey for array values. The aggregation pipeline provides efficient data aggregation by transforming documents through a series of pipeline stages that can filter, sort, group, and perform calculations on document fields and arrays.