Mining, in the context of blockchains and blockchain-like systems, generally refers to the 'work' done to validate, order, and secure the ledger's transaction history and state data. Mining, in this context, refers to the process of contributing this 'work' in return for a monetary reward of cryptoassets and is typically associated with those systems that use a mechanism called Proof of Work.
In Proof of Work mining, each node (or group of nodes within a mining pool) runs the same software on their hardware systems and competes to solve cryptographic puzzles. Winning a cryptographic puzzle involves trial and error repeatedly until a match is found, and so the probability of winning usually correlates to the amount of computing power the node has to execute this trial and error. When a puzzle is solved, the node that solved it has won the right to transmit the most recent state of the ecosystem, or 'block', to the rest of the network. All nodes update their current state, thus forming a 'blockchain', and the process begins again.
When a node solves this puzzle, they also usually receive a reward in the form of a certain amount of cryptoasset, which is automatically sent to their pre-defined wallet address, thus incentivizing nodes to participate in this 'mining' process in the first place. Therefore, 'mining' can be thought of as expending computing power or work to convert that energy into a cryptoasset.