MapDispatchToProps doubt in connect in react-redux

Code one:

import { addTodo } from "./actionCreators"
import { bindActionCreators } from "redux"

function mapStateToProps(state) {
  return { todos: state.todos }
}

function mapDispatchToProps(dispatch) {
  return bindActionCreators({ addTodo }, dispatch)
}

export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)

Code 2:

import { addTodo } from "./actionCreators"

function mapStateToProps(state) {
  return { todos: state.todos }
}

const mapDispatchToProps = {
  addTodo
}

export default connect(mapStateToProps, mapDispatchToProps)(TodoApp)

the role of the above two pieces of code is to inject todos and specific action creation functions. There is a bit of confusion where
code 1 calls bindActionCreators but not in code 2. The effect of the two pieces of code is the same.
what is the purpose of bindActionCreators ?

Oct.29,2021

function bindActionCreator(actionCreator, dispatch) {
  return (...args) => dispatch(actionCreator(...args));
}

/*
 * @param actionCreators
 * @param dispatch
 * @return {actionKey: (...args) => dispatch(actionCreator(...args))}
 */
export default function bindActionCreators(actionCreators, dispatch) {
  return mapValues(actionCreators, actionCreator =>
    bindActionCreator(actionCreator, dispatch)
  );
}

bindActionCreators part of the source code, in which the dispatch method

is called.
Menu