What is useReducer hook

import React, { useReducer } from 'react'

const initialState = 0
const reducer = (state, action) => {
    if(action.type === 'INCREMENT'){
        return state +  1;
    }else
    if(action.type === 'DECREMENT'){
        return state -  1;
    }
    console.log(state, action)
    return state;
}

export const UseReducer = () => {
    const [state, dispatch] = useReducer(reducer, initialState)
    return (
        <>
            <div className='container m-5'>
                <h1 className='ml-5'>{state}</h1>
                <div>
                    <button onClick={()=>dispatch({type : "INCREMENT"})} className="btn btn-primary m-1">Inc</button>
                    <button onClick={()=>dispatch({type : "DECREMENT"})} className="btn btn-primary m-1">Dec</button>
                </div>
            </div>
        </>
    )
}