Server Components run on the server and do not have access to browser APIs or React hooks like useState. State must be managed in Client Components or via server actions that update server state.
Client Components run in the browser and can hold interactive state using React hooks like useState. Server Components cannot respond to user events directly.
Server Components run on the server and are recreated on each request, so their state does not persist. Client Components run in the browser and keep state in memory during navigation.
Next.js uses the special directive "use client"; at the top of the file to mark a component as a Client Component. This enables hooks like useState.
If navigation causes a full page reload, Client Components unmount and lose their state. Proper client-side routing preserves component state during navigation.