A little more precisely, a backhoe is an add-on device that attaches to the back of a tractor or a front-end loader. The backhoe attachment consists of some controls, a jointed boom arm, and a bucket. There are usually several interchangeable buckets. The bucket is, as stated, used to dig or to scoop up and load materials into a dump truck or other cargo vehicle. The backhoe/bucket linkage usually allows the bucket to swing through 180 degrees of motion (or more) which provides flexibility in digging angles and options (for squaring off holes, and so on).
Sometimes the backhoe is operated from the cab of the tractor/front-end loader. Higher end models have their own rear-facing seat for better control and visibility. Most models also have hydraulic outriggers which can be lowered on either side of the host vehicle. These provide stability. The boom arm plus bucket is typically between 6 and 12 feet long, fully extended.
The configuration with a front-end loader is common for construction jobs, and this whole vehicle is often called a backhoe for simplicity's sake.