Role of karma in Buddhism

What role does karma play in Buddhism? Who does it affect, and how does it affect them in this life, the

afterlife, and the next life?