Option 1: Take a photo
is that all they do?
Well, this is simplistic. Taking a picture is not point-and-shoot. The lighting should be right, probably you do not want shadows, or probably you want them. So there could be controlled lighting.
But you can also extract 3D information from the photoshoot, for example, different lighting setup for a normal map.
Another additional process would be converting it to a seamless texture, so, it is not "only" taking a photo.
Option 2: Paint it
2D paint is a beautiful craft, it can be done, for example for backgrounds, the same way matt painting is done for a movie.
Option 3: Generate it
A lot of textures can be procedurally generated. Noise, strings, gradients, another type of noise. Add some blending modes, add more procedural nodes, and you have them.
Some programs to do this are built inside the 3d program like in Blender or can be standalone. Substance painter, Filter forge, Genetica, etc.
A texture is not just a texture, but a series of them. Diffuse map, bump map, normal map, specular map... Depending on the software you get just the diffuse map or you generate some more of them as different files.
Option 4: Draw it
Some textures are really simple. A rectangle with color can be a diffuse map and a grayscale one can be a bump map. This type of texture can be done for mechanical parts. One canal here, some bolts there.
Option 5: Cook it
Sometimes you generate a 3D model, and extract a map from the generated render and use it as a new 2D texture, mostly done to accelerate render times.
Option 6: Sculpt it
In sculpting tools, you can sculpt details, and in a similar way to the previous one, extract the rendered information to generate a displacement map to generate a new texture.
Option 7: 3D paint it
It is like using an airbrush on a 3d model. Normally is for general gradients.
Option 8: Combine them
You can make use of whatever resources you have. A texture can be applied in a different way than the first plan.
Here is a little tutorial I did some time ago, using just 1 texture and transforming it into rust, scratched paint, and dust.
Overlay to make image look dusty with fragmented text
The concept of paint it also includes this. The usage of a brush is using a texture to generate more texture.
Option 9: Use pre-made materials
You can buy photos, not necessarily taken by you.
You can use materials already made by someone else, using prepared maps.
You can use a library specifically made for your 3D application. Some software has an active community that makes libraries and shares them.
Option 10: Extract them
For example, Photogrammetry can be used to generate 3D models using photography. The generated model includes the texture.