Stateflow and PID are two completely different concepts. Stateflow is a product in MATLAB that helps in designing and simulating state machines and flowcharts. Where as, PID Controller is a block in Simulink which helps you create, configure and tune a PID controller used in Control system design.
Please go through the following docs for the basics of these two:
For stateflow: https://www.mathworks.com/help/stateflow/gs/product-description.html
For PID controller: https://www.mathworks.com/help/control/pid-controller-design.html