Can someone explain to me what stty does?

I have a shell script inside Docker. This is not mine, unfortunately I get the following error when running it. But only under Ubuntu 20.04 and Docker 19.03.

stty: ‘standard input’: Inappropriate ioctl for device

Here a cutout of line 126 from the script. What makes the stty echo and stty -echo? And why does the script run without problems on an system without docker?

askNoEcho() {
  PROMPT=$1
  DEFAULT=$2

  stty -echo
  ask "$PROMPT" "$DEFAULT"
  stty echo
  echo ""
}

askNonBlankNoEcho() {
  PROMPT=$1
  DEFAULT=$2

  while true; do
    stty -echo
    ask "$PROMPT" "$DEFAULT"
    stty echo
    echo ""
    if [[ -n "$response" ]]; then
      break
    fi
    echo "A non-blank answer is required"
  done
}

Source: Docker Questions