Skeletal muscles are attached to bones in two major ways: Indirect attachment and direct or fleshy attachment.
Indirect attachment: In this form of attachment there is a tendon between the muscle and the bone being pulled on. Tendons are considered to be part of the muscle by the way. Tendons are made of dense regular connective tissue (lots of collagen fibers all running in the same direction kind of like an untwisted rope) and they have lots of tensile strength (the weakest normal tendons can still withstand around 7000 pounds per square inch of force). The muscle’s other connective tissues (endomysium, perimysium, and epimysium) all converge to form the tendon and the tendon connects strongly to the bone with collagen fibers of the tendon connective to the periosteum of the bone or to the periosteum and directly to the bone itself. A good example of an indirect connection that you can feel on your arm right now is the attachment of the biceps brachii and brachialis muscles connection to the bones of your forearm, you can feel the muscle in the middle of your upper arm and follow it down to the tendons that insert into your radius and ulna.
Direct attachment or Fleshy attachment: In this form of muscle attachment there is no visible tendon, the muscle appears to connect directly to the bone. Between the muscle and the bone however the connection is basically the same as that of a tendon. The connective tissues of the muscle come together into a very short span of dense connective tissue that immediately inserts into the periosteum of the bone involved. The deltoid muscles at your shoulders are attached to your clavicle and scapula via fleshy attachment, and your pectoralis muscles are attached at your sternum also via fleshy attachment.