They should be used in place of normal remote events and functions (note that some libraries don’t support remote functions).
No, they put a layer of abstraction on the Roblox remote events and networking systems to make them easier to work with.
They work by adding remote event invocations to a queue that gets emptied every PostSimulation (Heartbeat) event; the accumulated data is then sent all at once through a single reliable or unreliable remote event. To differentiate events in the data, they assign a unique ID to them (which are shared to the client; I believe some of them create a folder with attributes for this) which then also needs to be sent.
local ShootEvent = DeclareEvent("Shoot")
-- Shoot will receive an ID of, let's say, "0" (string)
local ReloadEvent = DeclareEvent("Reload")
-- Reload will receive an ID of "1"
ShootEvent:FireClient(player, data)
--[[
In the player's queue now:
{
["0"] = contents of data,
}
]]
ReloadEvent:FireClient(player, otherData)
--[[
In the player's queue now:
{
["0"] = contents of data,
["1"] = contents of otherData
}
]]
When the recipient receives the table, they read the IDs for each set of arguments and will know which event they are for; thus, they can call all related event handlers.
The way they “work better than remote events” is saving bandwidth (how much data is transferred, in bytes) via the queuing functionality. Say I have two different remote events “A” and “B” and fire them on the same frame. Each remote event sends their respective data but also a small overhead of 9 bytes. That’s, in total, 18 bytes plus the data you used. With the networking library, events “A” and “B” are grouped into a single remote event call, reducing the overhead from 18 bytes to 9 bytes. Now, there’s still going to be some extra data for the IDs, but the ID overhead is still less than those 9 bytes.
Specifically, assuming that the events are indexed “0” and “1,” the ID overhead will be 6 bytes (3 bytes for each string), so you’ll be saving 3 bytes. The improvements scale more dramatically when firing, say, 100 events in the same frame.
Yes, they will be able to read the arguments passed because the libraries still use the Roblox remote event under the hood. It’ll be more difficult with ByteNet, though, because everything gets encoded in a buffer, but given enough time, they’ll figure everything out. Exploiters can also manually fire them and pass in whatever arguments they’d like.
The most performant library is probably ByteNet. The source code is littered with micro-optimizations and takes full advantage of native code generation, so it runs extremely quickly. It’s also the best for reducing bandwidth because it makes full use of buffers (will take some time to learn and get used to as you need to specify argument types, so make sure to really read the documentation). If you want to use something less foreign, the other networking libraries are fine.