I'll start with in-universe lore, and go onto mechanics second...
So, the handbooks says it best when is says that all understanding of anything magical begins and ends with the weave. The weave is a force and structure that permeates every fibre of existence in the realms – it's an essential element of the multiverse. The weave itself is, in the very literal sense, the form and source of all magic. You can't see or detect the weave itself, generally speaking – not even with spells – but you draw from it to use magic, functionally constructing/building/waving the shapes and forms of the spells you make from threads of the weave, to give them actualisation in the world.
You could, if you wanted to make a broadly similar parallel, compare it tot he force in certain sci-fi series... at least in a way. In the manner of its existence in relation to the tangible world, perhaps.
Everyone and everything that uses magic, in nay way, does so by drawing on the weave; the weave is not aligned, and gods, fiends, fey and mortals alike all draw on it to do their magic.
There have been a few instances in the history of the realms where the wave had died; Mystra (a deity, but also in many ways a 'position', since the Mystra we have now is not the same person as the Mystra we had at a previous time) is the keeper of the weave, the embodiment of the weave, and quite literally the weave itself; in the past times when Mystra died or was cut off from her divinity, magic itself failed, and was temporarily gone from the realms entirely, for everyone.
Anyone with the requisite skill, natural talent or knowledge can draw on the weave, but
How an individual draws upon the weave varies; everyone who uses magic does, but the methods are different.
A
Sorcerer has within them an innate, direct connection to the energies of the weave, and draws upon it directly, themselves – this often is coupled with a lack of knowledge or understanding that a learned individual might have (because the sorcerer will be a magic user, no matter if they want to or not), and also a lack of protection or control that working through an intermediary affords – a sorcerer must learn to deal with their power without killing themselves or others, because it generally wants to be used, and often doesn't want to take 'no' for an answer. Sorcerers come to be through many different methods – exposure to chaotic magical events, planar incursions, bloodline gifts from magical creatures, etc.
Clerics access the weave by way of divine intermediaries; they are faithful to deities who serve as the go-between for the cleric and the eave itself. In essence, the have a divine connection to their deity (the strength and capacity of which varies by cleric), and their deity provides them with power in a controlled and manageable way – the power still comes from the weave, initially, but it becomes the deity's power first, and is then challenged to the cleric.
Paladins Are usually in the same situation as clerics – getting their powers from their god – but certain paladins have found that the spark of tapping the weave lies within them already and are able to achieve effects of power on their own, through their own force of personality.
Warlocks are, in many ways, exactly like Clerics. They have a patron who serves as their intermediary to access the weave. They don't have innate capability to access the weave on their own, nor a divine connection; instead, they are gifted with power, channelled to them from their patron (who does have a powerful connection to the weave, just like a deity does). The main difference between a warlock and a cleric is that their deal with their patron is usually exactly that – a deal, or a bargain, and the mortal is often paying a very dear price of some sort for the power they are being given.
Druids and
Rangers tap the weave through the land itself, using the natural world as their conduit and the 'buffer' that helps them manage the weave in a controlled way. This method of utilising the weave tends to incline their magic in two main directions – subtle, self-fortifying effects, and expressions of the natural world, its beauty and its power.
Bards have a lot of overlap with sorcerers, though the expression of their power is usually less dangerous and less demanding. They are natural, innate casters who utilise the weave without an intermediary, but they channel it through music, song and art, and this acts as their conduit to give it shape and regulate the flow of power.
Wizards are unique in that as spellcasters, they actually have no innate natural connection to the weave at all, and no deity or patron to provide them with one. They are, in fact, entirely mundane, 'normal' mortals with no magical 'ability' in them. What a wizard has, is academia, and their iron-clad ability to utilise shape, form and sound in order to evoke strands of weave directly, even though they cannot actually 'feel' the flow of the weave, in the same way that innate casters and those with connections to other powerful entities do. At best, a wizard feels the movement of power by proxy – they build the scaffolding and pipes that shape the weave in the way they want to create their spells, and that cause it to flow, but they only feel it in the same way that you feel water flowing through a pipe when you put your hand on the metal.
Magical creatures tap the weave innately to achieve their special effects – like beholders hovering and vampire's potent charms; for them it's an in-build part of their essence and nature, and not something that taxes them or takes energy, generally speaking.
==
As for what this all means in a PnP game...
A spell, then is a discrete magical effect – it is threads of weave drawn forth, shaped in a particular way, and turned loose into the world to create an effect. Each spell has a level, from 0-9, that is a description of the power of the spell and how taxing it is on the caster to form and release.
What spells you can access are determined very specifically by your class; each class has a spell list, and those spells are the only ones that the can cast or learn to cast. These lists have a lot of overlap between them, but they are generally designed to differentiate the casting classes and show the style of spells that each class generally trends towards – druids have a lot of nature and elemental spells on their list, as well as things like commune with nature, speak with animals, barkskin, and so on, while clerics have a lot spells that are traditionally associated with divine providence in some way.
A break down on what spells are and how they are cast can be found here:
https://www.dndbeyond.com/sources/phb/spellcasting#SpellcastingSo, the question of “What makes a wizard spell?” is very simple – If it's on the Wizard spell list, it's a wizard spell. If it's not, it's not.
You can gain spellcasting options from different sources, of course, and there are perks, feats and other features that may add to, extend or change your spell list. A common phrase you might see on class perk that grants extra spell access is “This spell counts as a wizard spell for you”, which is denoting that, even though the spell might not normally be on your wizard class spell list, having learned this spell, it now counts as being a wizard spell for you anyway, and will work with your other class features that affect your wizard spells specifically.