How does state work in React and how is it different from props?