A 2D (two-dimensional) DP state uses two indices: . Each combination of and represents a unique smaller problem to solve. For example, might mean "the answer when you've processed items and used weight 5." You can think of it as a table. Rows are one dimension, columns are another.
Each cell stores the answer to one specific subproblem. The base cases initialize some cells (often or the first row/column), and the final answer comes from a specific cell or a combination of cells.