Optimal substructure refers to a scenario where a complex problem can be divided into smaller, more manageable subproblems, each of which can be solved optimally. When these sub-solutions are combined, they form an optimal solution to the original problem. This principle is particularly useful in dynamic programming and greedy algorithms.